MySQL 5.7 忘记 root 密码

忘记 root 密码:
(1)配置文件加:skip-grant-tables
(2)/etc/init.d/mysql restart
(3)root 登陆修改密码
UPDATE user SET authentication_string=PASSWORD('xxx') WHERE user='root' AND host='localhost';
FLUSH PRIVILEGES;
(4)删除配置文件中的 skip-grant-tables
(5)/etc/init.d/mysql restart

你可能感兴趣的:(MySQL 5.7 忘记 root 密码)