您的位置:首页 > 数据库 > MySQL

忘记MySQL密码的处理办法

2007-05-08 13:48 309 查看
参考http://www.freelamp.com/1003235699/1003235779/index_html

1.先杀掉mysqld的进程:

kill -TERM mysqld
2.使用skip-grant-tables这个选项启动MySQL:

/usr/bin/mysqld_safe --skip-grant-tables
3.登录修改密码:

#mysql -u root -p
mysql>use mysql;
mysql>update user set password=password('new_pass') where user='root' ;
mysql>flush privileges;
mysql>exit;
4.关掉MySQL

#mysqladmin -u root -p shutdown
5.启动MySQL

#/usr/bin/mysqld_safe --user=mysql &本文出自 “sharp” 博客,请务必保留此出处http://sharp.blog.51cto.com/134660/25998
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: