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