2009年10月26日 星期一

重設mysql密碼

1. 停止mysqld
# killall mysqld
2.
# mysqld -u root --skip-grant-tables &
Starting mysqld daemon with databases from /var/lib/mysql
# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> 
3.進入mysql後執行下列命令 new password 自行更改為新密碼
use mysql;
UPDATE user SET password=password('new password') where user='root';
FLUSH PRIVILEGES;

沒有留言: