忘记mysql用户密码怎么办?

忘记mysql用户密码怎么办?
作者: falcon   发表日期: 2007-04-05 21:50   复制链接



1. stop the mysql server
$ps -ef | grep mysqld
then  kill one by one
OR
$killall -TERM mysqld

2. start the mysql server with the following command
$ /usr/bin/mysqld_safe --skip-grant-table &

3. change your password for root
mysql> use mysql;
mysql> update user set password=password("new password") where user="root";
mysql> flush privileges;
mysql> quit

4. restart the mysql server with normal mode
/etc/init.d/mysql restart

转自:
http://www.cndw.com/tech/data/2006050864444.asp
有改动

你可能感兴趣的:(忘记mysql用户密码怎么办?)