1

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?

9
  • Same here, I've been trying to use HeidiSQL, MySQL Workbench, and NaviCat, and none of them allow me to connect to the server. Commented Feb 28, 2012 at 20:44
  • how did you create the ssh tunnel ? can you please post your command ? Commented Mar 2, 2012 at 9:34
  • @dom First way , is putty: oldsite.precedence.co.uk/nc/putty.html (ofc. with different ports), second way I've tried is the SSH connection tunnel option in the Navicat Premium - in both cases I get the same errors. Commented Mar 2, 2012 at 11:46
  • @Cyclone have you tried it doing that way: realprogrammers.com/how_to/set_up_an_ssh_tunnel_with_putty.html Commented Mar 2, 2012 at 12:29
  • @dom ... This is the same as this: oldsite.precedence.co.uk/nc/putty.html , result is the same too: 2013 - Lost connection to MySQL server at 'reading initial communication packet', system error: 0 Commented Mar 2, 2012 at 12:47

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

Comments

1

Login to your local Linux machine then run this command:

ssh -L 3307:localhost:3306 -N [email protected]

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.