www.webdeveloper.com
Results 1 to 3 of 3

Thread: #2013 - Lost connection to MySQL server at 'reading initial communication packet'

  1. #1
    Join Date
    May 2008
    Posts
    27

    #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!

  2. #2
    Join Date
    Aug 2005
    Location
    The Garden State
    Posts
    5,634
    sounds like you need to enable IP binding in my.cnf. look at the value of 'bind-address'

  3. #3
    Join Date
    Jan 2009
    Posts
    1

    more detail

    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:

    Code:
    ssh -v -f -N -L 3307:192.168.0.1:3306 user@host.server.com
    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!

    I hope this is helpful to someone.
    Last edited by chazzy; 01-08-2009 at 06:50 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles