简体   繁体   English

更新mysql root用户密码?

[英]Update mysql root user password?

How can I update the root users authentication string in mysql 5.7? 如何在mysql 5.7中更新root用户身份验证字符串?

I've tried: 我试过了:

UPDATE mysql.user SET authentication_string='-?"adBSasfasdfAWw-9?^2}-H'%KLP@' WHERE user='root';

But no luck. 但是没有运气。

Where am I going wrong? 我要去哪里错了?

Read https://dev.mysql.com/doc/refman/5.7/en/assigning-passwords.html 阅读https://dev.mysql.com/doc/refman/5.7/en/assigning-passwords.html

And use SET PASSWORD FOR 'root'@'localhost'; 并使用SET PASSWORD FOR 'root'@'localhost';

Don't update MySQL password data directly, because different authentication plugins may hash the password differently. 不要直接更新MySQL密码数据,因为不同的身份验证插件可能会以不同的方式对密码进行哈希处理。 SET PASSWORD takes this into account. SET PASSWORD考虑到这一点。

And don't post your root password on the internet. 并且不要在互联网上发布您的root密码。 :-) :-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM