When you remotely connect to mysql, the message "is not allowed to connect to this MySQL server" is displayed. mysqlallowed
ERROR 1130: Host '192. 168.1.3 'is not allowed to connect to this MySQL server. this tells you that you are not authorized to connect to the Host with the specified IP address. Let's take a look at the solution.
There are two solutions:
1. (How to Solve the connection between the client and the server (mysql): xxx. xxx is not allowed to connect to this mysql serv
) Authorization method. For example, if you want myuser to use mypassword to connect to the mysql server from any host.
The Code is as follows: |
Copy code |
Grant all privileges on *. * TO 'myuser' @ '%' identified by 'mypassword' with grant option; |
If you want to allow myuser to connect to the mysql server from a host whose ip address is 192.168.1.3, and use mypassword as the password
The Code is as follows: |
Copy code |
Grant all privileges on *. * TO 'root' @ '192. 168.1.3 'identified by 'mypassword' with grant option; Grant all privileges on *. * TO 'root' @ '10. 10.40.54 'identified by '000000' with grant option; |
2. Change the table method. It may be that your account is not allowed to log on remotely, but only on localhost. At this time, you only need to log on to the computer of localhost. After logging on to mysql, change the "host" item in the "user" table in the "mysql" database and rename it "%" from "localhost"
This is because of permission issues. The solution is as follows:
The Code is as follows: |
Copy code |
Shell> mysql -- user = root-p |
Enter Password
The Code is as follows: |
Copy code |
Mysql> use mysql Mysql> grant select, INSERT, UPDATE, delete on [db_name]. * TO [username] @ [ipadd] identified by '[password]'; |
[Username]: User code for remote login
[Db_name]: indicates the name of the database to be opened to the user.
[Password]: User password for remote login
[Ipadd]: The DNS Name after IP address or IP address reverse lookup. In this example, enter '60-248-32-13.hinet-ip.hinet.net '. Enclose the quotation marks (')
(In fact, it is executed on the remote server. Fill in the IP address of the local host .)
You can also write it like this.
The Code is as follows: |
Copy code |
Mysql-u root-pvmwaremysql> use mysql; mysql> update user set host = '%' where user = 'root'; mysql> select host, user from user; |