ERROR 2013 (HY000): Lost connection to MySQL server during query

If you’ve just set up a new mysqld service and your getting the above error when trying to connect over TCP (even when tunnelling in over SSH), don’t fret. The answer lies in /etc/hosts.allow. You need to add in a line similar to this:


This foxed me a while ago and I didn’t get round to fixing it as it wasn’t yet mission critical, however it also stopped us dead in our tracks yesterday. Thank fully to Neil in Core Services who had a moment of clarity we’re now back in business.


Now I know the problem, a little more simpler Google querying led me here a 2004 post on MySQL’s access denied troubleshooting page which mentions that the cause of this is mysqld being compiled with tcp-wrapper support.

2 thoughts on “ERROR 2013 (HY000): Lost connection to MySQL server during query

  1. It certainly isn’t obvious, especially since:

    MySQL has three other ways of restricting access
    Several hours of searching for various keywords threw up nothing
    It wasn’t compiled like this in the previous SP of SLES

    Might be able to get on with some work now…

  2. That happens to me all the time……
    Glad to hear things on back on track on the development server,
    Thanks Rachel

Comments are closed.