zbb20170811 MySQL Remote connection error: Host * isn't allowed to connect to this MySQL server, workaround

Source: Internet
Author: User
Tags mysql client

There are 2 ways to resolve this issue:

localhost changed to%

1. Go to the MySQL bin directory

Note: Root is the administrator user name, password is the user root password:

Mysql-u root-p Password

Mysql>use MySQL;

Mysql>update User Set host = '% ' where user = ' root ' and host = ' localhost ';

Mysql>flush privileges;

Note: The MySQL client connecting to this server needs to be restarted and then connected to this server.

Specific analysis

1, after the computer log in MySQL, the "MySQL" Database in the "User" table "host", from "localhost" to the '% '.

Mysql>
Mysql>use MySQL;
Mysql>select ' host ' from user where user= ' root ';

#查看mysql库中的user表的host值 (Host/IP name for connection access)

A different approach

If you are using the client software, we can use the client software on the MySQL server to enter, in the Query Analyzer input: (Note that you must be a root user login oh, otherwise it is not modifiable)

Use MySQL;
SELECT * from user where user= ' root ';

In the query results (only one) directly modify the host column value, changed from localhost to #, click Apply to run can be modified. Then reboot the client and reconnect.
Or:

Use MySQL;

Update user Set host = '% ' where user = ' root ' and host= ' localhost '

Then reboot the client and reconnect.

zbb20170811 MySQL Remote connection error: Host * isn't allowed to connect to this MySQL server, workaround

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.