1.先停掉mysql
# /etc/rc.d/init.d/mysql stop
2.以--skip-grant-table 的參數啟動mysql
# safe_mysql --skip-grant-table&
3. 更改root 密碼
# mysql mysql
mysql> UPDATE user SET password=password('newpassword')
WHERE user='root';
mysql> FLUSH PRIVILEGES;
mysql> exit
4.停掉mysql再重跑
# mysqladmin -uroot -p shutdown
Enter password: //輸入新設定的密碼
# /etc/rc.d/init.d/mysql start
沒有留言:
張貼留言