I am having trouble setting up the replication via SSH
tunnel despite many hours spent throught the official docs, articles and SO questions.
My master is 192.168.0.105
and the Slave is 192.168.0.104
. I have already set up the SSH tunnel via:
ssh -L 3305:127.0.0.1:3306 tunneluser@192.168.0.105 -f -N
where tunneluser
is a local user on my master.
I get the following output on a slave (omitted the irrelevant lines):
mysql> SHOW SLAVE STATUS \G
*************************** 1. row ***************************
Slave_IO_State: Connecting to master
Master_Host: 127.0.0.1
Master_User: slave_user
Master_Port: 3305
...
Slave_IO_Running: Connecting
Slave_SQL_Running: Yes
...
Last_IO_Errno: 2003
Last_IO_Error: error connecting to master 'slave_user@127.0.0.1:3305' - retry-time: 10 retries: 1
...
1 row in set (0.00 sec)
The part that puzzles me is that if I try:
mysql -h 127.0.0.1 -P 3305 -u slave_user -p
It logs-in without any issues. I am beginning to think this has something to do with permissions, but I cannot find any hint to confirm my theory.
I tried to setup the tunnel as mysql
user, however, that did not work as well. Didn't really expect but I had to give it a shot.
Does anyone have any suggestion on how to debug this?
If I go directly through port 3306
, it works without any issue.