ERROR 2013 (HY000): Lost connection to MySQL server at 'rea

回覆文章
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

ERROR 2013 (HY000): Lost connection to MySQL server at 'rea

文章 yehlu »

http://jerrywalsh.org/2009/solving-mysq ... -0130.html

Recently it became necessary to expose a MySQL instance to some customers across the internet. The MySQL daemon had previously been locked down using the my.cnf skip-networking directive. I removed this the MySQL configuration file and restarted the daemon. Sockstat showed MySQL was now listening but when I attempted to connect from a remote site I received this cryptic error message:

代碼: 選擇全部

 ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0
Nothing showed on any logs (system logs or even the MySQL error log) so I was stumped for a little bit. Also, connecting to the mysql server via its socket or localhost worked just fine. After some painful moments I finally figured out what the problem was - MySQL uses tcp wrappers and so I had to make the appropriate entry in /etc/hosts.allow:

代碼: 選擇全部

mysqld : ALL : allow
Once added remote connections were instantly accepted and the error message went away - hurray!
回覆文章

回到「MySQL」