跳到主要内容

MySQL忘记root密码解决办法

Public

MySQL忘记root密码解决办法 :在linux下:

  如果 MySQL 正在运行,首先杀之: killall -TERM MySQLd。

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

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

  然后就是

  1.>use MySQL

  2.>update user set passwordpassword=password("new_pass") where user="root";

  3.>flush privileges;

  重新杀 MySQL ,用正常方法启动 MySQL 。


mysql
0