MySQL Remote connection loss problem solving method

Source: Internet
Author: User


The specific resolution steps are as follows, hoping to help students who have the same problems:

Locate and modify the My.cnf file. Under different Linux systems, my.cnf are placed in different locations. Here is an example of Ubuntu server, and other systems should find the path to my.cnf as appropriate. Usually only stored in/etc/my.cnf or/ETC/MYSQL/MY.CNF.
First open my.cnf with vim:


Vim/etc/mysql/my.cnf

To see if there is any configuration of the address of the loop, and if so, comment out the following text: (Add the # before the text)


Bind-address = 127.0.0.1

Then find the parameters in the [mysqld] section, create a new line after the configuration, and add the following parameter:

Skip-name-resolve

Save file and restart MySQL:

/etc/init.d/mysql restart

This will find that the problem has been solved! Remote connections are not lost.

Supplemental MySQL Connection not reason

1. First of all, troubleshoot network problems and firewalls
This is necessary, if you can not even MySQL server, then access to what? How to check it? Ping
Ping 192.168.0.11 Ping's pass, then go to check the 3306 port is not blocked by the firewall
Ping 192.168.0.11:3306 or simply turn off the firewall, service iptables stop (Redhat) or UFW disable (Ubuntu)
If this step is no problem, start the next step:

2. To troubleshoot there is no access to access rights, when the MySQL distribution user will specify a host, such as my host designated as 192.168.0.5, then this account can only 5 of this machine access, the other machines with this account access will be prompted no right Limit. The host specified as% means that all machine access is allowed.

Generally speaking, for security reasons, follow the principle of least privilege, the issue of permission is not much said, do not check the manual. If you've identified permissions, proceed to the next step:

3. To troubleshoot MySQL configuration          
Check the MySQL configuration file, Linux under the MySQL configuration file called my.cnf Windows is called My.ini, check this configuration item:          –bind-address=ip    

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.