A MySQL database was recently installed on Linux, but the remote connection to MySQL always reported Erro 2003:can ' t connect to MySQL server on ' 211.87.***.*** ' (111), It took several hours yesterday to find the solution, as follows:
1.sudo gedit/etc/mysql.my.cnf
Find Bind-address =127.0.0.1
Modified to Bind-address =0.0.0.0
2.sudo/etc/init.d/mysql restart
In this case, if you try a remote connection again, the error 1130 (HY000) is reported: Host ' 211.87.***.*** ' is not allowed to connect to this MySQL server prompt, and the database cannot be connected remotely.
On MySQL host, follow the instructions below
Mysql-u Root-ppassword//Enter the MySQL console
Mysql>use MySQL;
Mysql>update User Set host = '% ' where user = ' root '; This command can be skipped when executing an error
Mysql>flush privileges;
Mysql>select host, user from user; Check that '% ' is inserted into the database
Mysql>quit
3. Other
Mysqladmin-u root Password 123//Change Password
Add skip-grant-tables//Skip MySQL access control in/ETY/MY.CNF