mysql 重置密码

sudo service mysql stop
sudo mysqld_safe --skip-grant-table&
mysql
use mysql;
update user set password = password('yourpasswd') where user = 'root';
flush privileges;

重启登录后,如果提示:You must SET PASSWORD before executing this statement
解决:

mysql>  SET PASSWORD = PASSWORD('123456');

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注