MySQL 重置 root 密码 - 忘记密码
- 作者: 晴天丶晒裤衩
- 来源: 51数据库
- 2020-08-12
|
在配置文件/etc/my.cnf添加配置,重启mysql ##无密码登录 skip-grant-tables 客户端连接mysql选择mysql库 mysql -uroot -p use mysql; 修改root密码5.7版本,5.7版本之后已经没有了password字段,而是用authentication_string加密字段代替 update mysql.user set authentication_string=password('root') where user='root'; 5.7版本以前 update mysql.user set password=password('root') where user='root'; |
推荐阅读
