Chinaunix

标题: mysql忘记root密码情况的处理 [打印本页]

作者: sss0213    时间: 2008-09-19 11:07
标题: mysql忘记root密码情况的处理
ps -aux | grep mysql
   
   如果 MySQL 正在运行,首先杀之: killall -9 mysqlpid。 启动 MySQL :safe_mysqld --skip-grant-tables & 就可以不需要密码就进入 MySQL 了。 然后就是
>use mysql
>update user set password=password("new_pass") where user="root" and host='localhost';
>flush privileges;
重新杀 MySQL ,用正常方法启动 MySQL 。


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/50685/showart_1206038.html




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2