When you remotely connect to mysql, the message "is not allowed to connect to this MySQL server" is displayed. mysqlallowed

Source: Internet
Author: User

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;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.