linux下忘记mysql的root密码

一.处理方案

#1. 结束当前正在运行的mysql进程

 /etc/init.d/mysql stop

#2. 用mysql安全模式运行并跳过权限验证

mysqld_safe --user=mysql --skip-grant-tables --skip-networking &

#3. 用空密码方式使用root用户登录 MySQL

#  mysql -u root mysql 

#4. 更新密码为root

update user set Password = PASSWORD('root') where User ='root';

#5. 刷新权限

FLUSH PRIVILEGES; 

#6. 退出

quit
上一篇:【转载】windows 下重置 mysql 的 root 密码


下一篇:CentOS6.2上安装Oracle10g报ins_emdb.mk错误处理方法