设为首页收藏本站

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 574|回复: 1

Reset MySQL Root Password

[复制链接]
发表于 2011-5-11 22:47:54 | 显示全部楼层 |阅读模式
Have you ever forgotten the root password on one of your MySQL servers? No? Well maybe I’m not as perfect as you. This is a quick h00tow (how to) reset your MySQL root password. It does require root access on your server. If you have forgotten that password wait for another article. Original article posted on reset mysql root password.



First things first. Log in as root and stop the mysql daemon. Now lets start up the mysql daemon and skip the grant tables which store the passwords.



mysqld_safe --skip-grant-tables

You should see mysqld start up successfully. If not, well you have bigger issues. Now you should be able to connect to mysql without a password.



mysql --user=root mysql
update user set Password=PASSWORD('new-password') where user='root';
flush privileges;
exit;

Now kill your running mysqld, then restart it normally. You should be good to go. Try not to forget your password again.
发表于 2011-5-13 10:11:19 | 显示全部楼层
楼主果然好帖
顶!!!!




VIGGIE GREEN,VIGGIE GREEN,VIGGIE GREEN,VIGGIE GREEN
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|BC Morning Website ( Best Deal Inc. 001 )  

GMT-8, 2025-8-26 02:18 , Processed in 0.016357 second(s), 19 queries .

Supported by Best Deal Online X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表