Loading... 在 `my.cnf`中添加: ``` skip-grant-tables ``` ![][1] 回到 `MySQL`目录重启mysql服务 ``` cd /opt/soft/mysql-5.7.30 service mysql restart ``` 登录mysql: ``` mysql -uroot -p ``` 使用mysql数据库: ``` use mysql ``` 修改密码: ``` UPDATE mysql.user SET authentication_string=PASSWORD('新密码') WHERE User='root'; FLUSH PRIVILEGES; ``` [1]: https://a-hxin.cn/usr/uploads/2023/04/2677392591.png 最后修改:2025 年 04 月 09 日 © 允许规范转载 打赏 赞赏作者 赞 咱们谁跟谁,用不着~