Mysql remote connection Host * isnotallowedtoconnecttothisMySQL

Source: Internet
Author: User
If mysql does not support remote connection, the following error code is displayed: error code 1130, ERROR1130: Host * isnotallowedtoconnecttothisMySQLserver,

If mysql does not support remote connection, the following ERROR code is displayed: ERROR 1130: Host * is not allowed to connect to this MySQL server,

There are two methods to solve this problem:

Change localhost to %

Enter the BIN directory of mysql

The code is as follows:

Mysql-u root-p

Mysql> use mysql;

Mysql> update user set host = '%' where user = 'root ';

Mysql> flush privileges;

Detailed analysis

1. after logging on to mysql on the local machine, change the "host" entry in the "user" table in the "mysql" database to "%" from "localhost '.

The code is as follows:
Mysql>
Mysql> use mysql;
Mysql> select 'host' from user where user = 'root ';

# View the host value of the user table in the mysql database (the host/IP name for connection access)

The code is as follows:
Mysql> update user set host = '%' where user = 'root ';

# Modify the host value (add host/IP addresses with the wildcard % content, or directly add a specific IP address. if ERROR 1062 (23000) occurs when the update statement is executed ): duplicate entry '%-root' for key 'primary' error. select host from user where user = 'root ';
Check whether the host has a value of %. If yes, run the following flush privileges command)

The code is as follows:

Mysql> flush privileges;
Mysql> select host, user from user where user = 'root ';
Mysql> quit

Another method

If you are using phpmyadmin, you can log on to phpmyadmin and go to the permission management page. all users are displayed. click modify as the root user, then, change the domain to "%" (note that you must log on as the root user; otherwise, the domain cannot be modified)

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.