Quickly solve mysql Lost connection to MySQL server at 'reading initial communication packet and can't connect to mysql server on 'localhost ',
When using Navicat to connect to a remote mysql database today, the system always prompts that the connection fails and that Lost connection to MySQL server at 'reading initial communication packet
However, the mysql service has been started.
Baidu found the solution as follows:
Modify hosts. allow
Vi/etc/hosts. allow # Add mysqld: ALL: ALLOWmysqld-max: ALL: ALLOW
Connect again, but the prompt "can't connect to mysql server on 'localhost'" is displayed. Baidu queries it again and draws the following conclusion:
No bind-address = 127.0.0.1 parameter in my. ini
But the my. ini file was not found on the server for half a day.
View the mysql Log again:
In this section:
151213 17:05:35 InnoDB: 5.5.37 started; log sequence number 16568257151213 17:05:35 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306151213 17:05:35 [Note] - '0.0.0.0' resolves to '0.0.0.0';151213 17:05:35 [Note] Server socket created on IP: '0.0.0.0'.151213 17:05:35 [Note] Event Scheduler: Loaded 0 events
Suddenly, I realized that I directly changed the connection property in Navicat:
Connection successful
Reference resources:
1. http://blog.sina.com.cn/s/blog_4cd14afb01012eox.html
2. http://blog.csdn.net/chengwenyao18/article/details/24112997