MySQL Remote connection problem Lost connection to MySQL server at ' reading initial communication packet ', System error:0

Source: Internet
Author: User
Tags mysql login

When I connect MySQL remotely with navicat for MySQL, there is a

Lost connection to MySQL server at ' reading initial communication packet ', System error:0

It's disgusting, the server restarted once, and all the morning it was dealing with MySQL problems.

Both methods do not take effect:

Modify the My.cnf file (Windows is My.ini)

General in the MySQL installation directory,/etc/mycnf.

In the MY.CNF configuration file in the [mysqld] area add skip-name-resolve, to see the Netizen is to skip the MySQL connection DNS reverse resolution function, so as to improve the performance of MySQL. In this case, you can only use the IP in the MySQL authorization table to connect to the MySQL service.

But it does not take effect. Attach several parameters to the MY.CNF configuration:
Skip-name-resolve skips the DNS reverse parsing process. (so you can't use hostname to connect to MySQL, only use IP connection)
Skip-grant-tables Skip Authorization Form (solution when MySQL login password is forgotten)
Skip-networking skipping TCP/IP connections
Skip-host-cache disable host name caching; To clear the hostname cache, execute the FLUSH hosts statement or execute the mysqladmin flush-hosts command

Put the client's IP in the MySQL server's/etc/hosts file, give a name to do the host mapping.

Because the working environment needs to access MySQL at multiple addresses, it is not realistic to maintain the hosts file, so it is eliminated ...

Finally found ...
Remote access to MySQL can be, is not local access, that is, you can run in the production environment as usual. That's disgusting.

MySQL Remote connection problem Lost connection to MySQL server at ' reading initial communication packet ', System error:0

Related Article

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.