计算机网络/计算机科学与应用/系统/运维/开发

linux下5.7版本mysql忘记密码解决办法


重置mysql的密码

如果 MySQL 正在运行,首先杀进程: killall -TERM mysqld

启动 MySQL :bin/mysqld_safe --skip-grant-tables &

就可以不需要密码就进入 MySQL 了


重新打一个连接窗口:

  >use mysql
  >update mysql.user set authentication_string=password("xxx") where user="root";
  >flush privileges;



mysql5.7

业精于勤而荒于嬉,行成于思而毁于随

评论

^