1. Cause analysis
MySQL server is installed on the server. After the service is started, the Mysql-u user name-p password can be connected normally, but not on the other machines.
There are two possible reasons for this problem:
- After MySQL is installed, the default is only open to 127.0.0.1 's native, not to the remote host.
Workaround:
(1) Find the default MySQL configuration file, usually/etc/mysql/my.cnf or/etc/my.conf
(2) Find bind-address= This option, modify to Bind-address = 0.0.0.0 (or modify the corresponding open IP address according to your own security requirements)
(3) Restart MySQL server (/etc/init.d/mysql stop/etc/init.d/mysql start)
- The user's permissions are configured correctly, the user does not have permission to telnet to the MySQL server
Solutions and correlation analysis See: http://www.cnblogs.com/wonder315/archive/2011/11/02/2233010.html
When you refer to this tutorial, there are some problems:
(1) When the method is used to change the table method, this situation occurs
ERROR 1062 (23000): Duplicate entry '%-root ' for key ' PRIMARY '
The reason is that there are multiple records in the root user and therefore fail.
(2) The second method, the authorization law, is thus used. It's done soon, and there's no problem. It is recommended to use this method
MySQL local can connect, remote connection not on the resolution