您的位置: 首页 > 文章 > mysql 忘记密码 mysql 忘记密码 分类: 文章 • 2023-11-10 13:11:21 场景 解决 场景 闲置一段时间的服务 ubuntu 16.04 忘记了密码 解决 修改mysql 配置文件 文件 /etc/mysql/mysql.conf.d/mysqld.conf 位置 标记行下面添加skip-grant-tables 重启mysql sudo service mysql restart mysql (不需要输入密码) 进入 执行更新命令 update mysql.user set authentication_string=password(‘新密码’) where user=’root’ ;