Oops! On my machine, I run FreeBSD OS with mysql on it. But today.... the passwd on mysql was changed by system! (I tried to change passwd via "change passwd" bottom on main page... somehow, it generated a passwd ramdomly!!)
Couldn't access my db..... so I go browsing the fine web!! XD
The solution is as following:
1. Stop mysql service first!!
# /usr/local/etc/rc.d/mysql-server stop
2. Then let's get into the safe mode.
# mysqld_safe -u root --skip-grant-tables &
3. In the mode....
a). # mysql
b). >use mysql //select the db "mysql"
c). >UPDATE user SET password=password('enter passwd here') where user='root';
d). >FLUSH PRIVILEGES;
e). >exit
Now, I can access again.....
No comments:
Post a Comment