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.