sudo su
mysqld_safe --skip-grant-tables --skip-networking &

UPDATE mysql.user SET password=PASSWORD(’新密码’) WHERE User=’root’;
mysql> FLUSH PRIVILEGES

update mysql.user set authentication_string=password('root') where user='root' ;

相关文章: