Solution to the "communications link failure" error of remote connection to MySQL

Source: Internet
Author: User

Recently, I was busy with completing the setup. I used MySQL to store some system metadata and encountered an error when using the system IP address to connect to MySQL. However, it was okay to use localhost to connect to MySQL.

Error message: communications link failure, last packet sent to the server was 0 MS ago.


The first thought was the authorization problem, that is, the authorized database has the remote access permission. There are two methods:

1) use the table change method

Mysql-u root-P mysql> use MySQL; mysql> Update user set host = '%' where user = 'ssj'; mysql> select host, user from user;

2) Authorization Law

Grant all privileges on cloudid. * To 'ssj' @ '%'; // cloudid is my database name, And ssj is my MySQL username flush privileges;

However, the authorization method is useless, and the modification of the table rule indicates that the user table already has this record. So what is the reason? After some searching on the internet, I found that the MySQL configuration file was originally a problem.

Modify the MySQL configuration file my. CNF (My. ini in Windows ),Bind-address = 127.0.0.1Just comment out this line.

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.