Mysql login error: ERROR 1045 (28000) kind of approach

1, disable MySQL service: # service mysql stop

2, enter the command: # mysqld_safe --user = mysql --skip-grant-tables --skip-networking &

3, into the database: #mysql -u root mysql

4、mysql> user mysql;

5, the query results in the user table (select user, host, password from user;), remove the empty table to the user query (delete from user where user = '');

6, exit the database: mysql> quit

7, start mysql service: # service mysql start;

8, re-use command 'mysql -u root -p' Log in, OK!

Guess you like

Origin www.cnblogs.com/learningkeeper/p/11358660.html