MySQL forget the root password, and MySQL ERROR 1130

Editing my.ini file, add the skip-grant-tables that line in mysqlld node, restart MySQL.
Open a DOS window, go to the mysql \ bin directory, enter mysql enter, if successful, will appear MySQL prompt.

mysql>use mysql;
mysql>update user set authentication_string=password('root') where user='root' ;
mysql>update user set host = '%' where user = 'root';
mysql>flush privileges;
mysql>select host, user from user;
mysql>quit

报错MySQL ERROR 1130 (HY000): Host ‘XXXX’ is not allowed to connect to this MySQL server

mysql>use mysql;
mysql>update user set host = '%' where user = 'root';
mysql>flush privileges;
mysql>select host, user from user;
mysql>quit
Released three original articles · won praise 0 · Views 675

Guess you like

Origin blog.csdn.net/haisong/article/details/104925974