mysql 8.0重置用户密码skip-grant-tables

2,809次阅读

共计 294 个字符,预计需要花费 1 分钟才能阅读完成。

使用 skip-grant-tables 模式


1. UPDATE mysql.user SET authentication_string=null WHERE User='root';
2. FLUSH PRIVILEGES;
3. mysql -u root
4. ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'yourpasswd';

非 skip-grant-tables 模式


1. ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'yourpasswd';

正文完
 
Blood.Cold
版权声明:本站原创文章,由 Blood.Cold 2019-06-08发表,共计294字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。