Quickly solve mysql Lost connection to MySQL server at & #39; reading initial communication packet and can & #39; t connect to mysql server on & #39; localhost & #39 ;,

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.