OSX fails to connect mysql to ssh tunnel
SSH tunnelling is a useful method for connecting to a MySQL server which is behind a firewall and restricted to localhost users. i.e. A web server
#create an SSH tunnel between the local port 9000 and the remote port 3306
ssh -L 9000:localhost:3306
# connect the local mysql client
mysql --port 9000 --host localhost -u user -p password
Workaround
On OSX specifying the host as localhost will cause the mysql client to attempt to connect to a socket file
/tmp/mysql.sock
which does not exist.
To work around use the loopback address to replace the hostname in the mysql command line
mysql -P 9000 -h 127.0.01 -u user -p password
« Go back
Powered by Help Desk Software HESK, in partnership with SysAid Technologies