Tagged with: localhost IP address update database wildcard
2, after the computer log in MySQL, the "MySQL" Database in the "User" table "host", from "localhost" to the '% '.
The code is as follows:
Mysql>
Mysql>use MySQL;
Mysql>select host from user where user= ' root ';
Mysql>update User Set host = '% ' where user = ' root ';
Modify the host value (add the hostname/IP address as the wildcard%), or you can add a specific one directly, if error 1062 (23000) occurs when you execute the UPDATE statement: Duplicate entry '%-root ' for key ' PRIMARY ' ERROR, requires select host from user where user = ' root ';
Check to see if the host has a% value, and if so, directly execute the following flush privileges;
The code is as follows
Mysql>flush privileges;
Mysql>select host,user from user where user= ' root ';
Mysql>quit
3.
ERROR 1044 (42000): Access denied for user "@ ' localhost ' to database ' MySQL '
1. Turn off MySQL
# Service Mysqld Stop
2. Blocking permissions
# Mysqld_safe--skip-grant-table
Screen appears: Starting demo from .....
3. Start a new terminal input
# mysql-u Root MySQL
mysql> Delete from user where user= ';
Mysql> FLUSH privileges;//Remember to say this, otherwise if you close the previous terminal, the original error will appear
Mysql> \q
Native setting up a remote database connection