Linux remote connection to mysql server:

Parameter meaning:
-h: Specify the location of the connected data server, which can be an ip address or a server domain name.
-u: Specify the user name used to connect to the database server, such as root
-p: The password used to connect to the database server
mysql -h 192.*** -u root -p //Specify the host name and user name of the server, enter after pressing Enter Password
Enterpassword:**** //Enter the password in the form of cipher text
Encountered problems:
error,
ERROR 1130(HY000):Host 'USER-20151006ZW' is not allowed to connect to this MySQL server
//Error message: USER- 20151006ZW (target server) is not allowed to connect to the MySQL server


Solution :
Change the table method. It may be that your account is not allowed to log in from the remote, only on localhost. At this time, as long as you are on the localhost computer, after logging in to mysql in cmd, change the "host" item in the "user" table in the "mysql" database from "localhost" to "%"

mysql>use mysql;
mysql> update user set host='%' where user='root';      
//Change the "host" item in the "user" table in the "mysql" database, from "

mysql>flush privileges; //Make the modification take effect
ps: Someone entered mysql in cmd to report an error, it may be that you did not add mysql to the environment variables, in Windows system, system properties, under advanced options, there is an environment variable button, click Go in, add your mysql installation path to the path, for example, mine is, "C:\Program Files (x86)\MySQL\MySQL Server 5.1\bin" (do not add double quotes, and each path is separated by ;)


experiment If successful, take a screenshot as a souvenir:


ps: For detailed screenshots, see the picture attachment

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326917889&siteId=291194637