Ways to resolve remote connection MySQL error 1130 code

Source: Internet
Author: User

using remote connections today Mysql Server database, no matter how the connection is not connected, the error code is 1130 , ERROR 1130:host192.168.2.159 is not allowed to connect to this MySQL server

conjecture is a problem with user permissions that cannot be given to remote connections. As a result, the OperationMySQLLibrary and can be resolved. Log in on this machineMySQLafter the change"MySQL"in the database."User"of the table"Host"items, from"localhost"renamed'% '..

Mysql-u root-p

mysql>usemysql;

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

Mysql>updateuser Set host = '% ' where user = ' root ';

mysql>flushprivileges;

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

The first sentence is the user with permission Root Login

The second sentence: select MySQL Library

The third sentence: view mysql user table host /IP name)

host value (in wildcards % /IP address), of course, can also be added directly ip address

Fifth sentence: Refresh MySQL the System permissions related table

Sixth sentence: Re-view User table, there are modifications:

re-up MySQL service can be completed.

=====================================================

    of this machineMySQLThere are two records in the database.user= ' root 'record, one of thehost= ' localhost 'of theHostmodified to'% ', although you can access the database remotely, use thelocalhostor127.0.0.1Unable to access the database again.

    after some tossing and finding, we can solve this problem by creating a user's method. No modification requiredUserany data in the table, locally using theRootLoginMySQL, execute the following statement to create a user named' Root ', the password is' 123456 'the user. When you're done, reviewUsertable and found a new onehost= '% ',user= ' root 'records, and the permissions and other' Root 'again, use192.168.1.13access, and found that it can be accessed normally.

?

1

2

3

4

Grant All

on *.*

to Root identified by ' 123456 '

with Grant option ;

If you have problems with your visit, you can perform flush Privileges;


This article from "Caramel Daddy" blog, reprint please contact the author!

Ways to resolve remote connection MySQL error 1130 code

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.