Linux Mint 18 安装的 MySQL 设置为密码为空以后, apt update 更新了 MySQL,然后使用空密码登陆不上了,怎么处理?

2017-07-21 09:03:35 +08:00
 coolair
994 次点击
所在节点    问与答
5 条回复
nullen
2017-07-21 09:06:08 +08:00
skip-grant-tables,然后重置密码。
coolair
2017-07-21 09:37:08 +08:00
@nullen ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
改了无用啊。
coolair
2017-07-21 09:41:22 +08:00
UPDATE mysql.user SET authentication_string = PASSWORD('MyNewPass')
WHERE User = 'root' AND Host = 'localhost';
FLUSH PRIVILEGES;
执行这条语句,也是无效。
gotounix
2017-07-21 09:47:46 +08:00
update mysql.user set authentication_string=null, plugin="mysql_native_password" where User='root';
coolair
2017-07-21 09:50:45 +08:00
@gotounix 可以了,多谢。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/376872

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX