#2013 - Lost connection to MySQL server at 'reading initial communication packet'
when I tried to use phpmyadmin, I always got this error:
#2013 - Lost connection to MySQL server at 'reading initial communication packet', system error: 111
any hints for that? Thanks!
sounds like you need to enable IP binding in my.cnf. look at the value of 'bind-address'
I realize this is a pretty stale thread but since there isn't much by way of documentation out there on this topic and I came across this same question, I wanted to share a bit more detail on the solution I found.
I eventually got it working by matching the "remote address" in the SSH command to the bind-address value in the my.cnf file on the remote server. For most people, the bind-address value is 127.0.0.1, but I have my MySQL server bound to a local network address (192.168.0.x). The correct command for me, therefore, was:
It seems that the "remote address" in the SSH command is the value used by MySQL to associate the tunneled user with an IP address. Depending on your configuration, MySQL likely either refuses connections from remote IPs or only allows the user you are logging in as to log in from locahost. Since we can't self-identify as "localhost" (we have to force TCP activity) we need to use an IP address, and that IP address needs to be whatever MySQL identifies as its own. This is the value of bind-address. In many cases, this is going to be 127.0.0.1 (that's why you see this proposed solution everywhere), but that's not always the case. Check your bind-address value!
ssh -v -f -N -L 3307:192.168.0.1:3306 firstname.lastname@example.org
I hope this is helpful to someone.
Last edited by chazzy; 01-08-2009 at 06:50 PM.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)