又忘了mysql的密码- -囧

service mysqld stop

mysqld_safe  --skip-grant-tables

UPDATE mysql.user SET Password=PASSWORD('xinmima') WHERE User='root';

FLUSH PRIVILEGES;

 

mysql5.6以后,users表没有password了,需要:

SET PASSWORD FOR ‘root’ = PASSWORD(‘NewPass’);

Leave a line?

This site uses Akismet to reduce spam. Learn how your comment data is processed.