Question

I've created an SSH tunnel on my local machine to reach an access to the mysql server on my remote machine. Everything is fine, tunnel is working if I get this error, but why this error occurs?

Here is the error message:

2013 - Lost connection to MySQL server at 'reading initial communication packet', system error: 0

It happends only, when I want to connect via Navicat (SSH Tunnel) from my local to the remote machine, on the remote machine mysql works without such errors.

Have you guys any solutions for that?

Was it helpful?

Solution

This error occurs when the configuration of the bind-adress option is wrong. Your MySQL server at least should listen on the localhost - 127.0.0.1

OTHER TIPS

Login to your local Linux machine then run this command:

ssh -L 3307:localhost:3306 -N user@remote.server.com

Use the mysql database from remote server:

mysql -u root -p --port 3307 -h 127.0.0.1

Make sure the local mysql does not use the same port in Linux environment.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top