忘了MySQL root密碼
时间:2007-09-11 来源:freemongolia
忘了MySQL root密碼
--------------------------------------------------------------------
(1)停止MySQL服務 /usr/local/etc/rc.d/mysql-server.sh stop
(2)以安全模式啟動 /usr/local/bin/mysqld_safe --skip-grant-table&
(3)進入mysql
#mysql mysql
#mysql>UPDATE user SET password=password('newpassword') WHERE user='root';
#mysql>quit
(4)重新再跑MySQL mysqladmin -uroot -p shutdown
(1)停止MySQL服務 /usr/local/etc/rc.d/mysql-server.sh stop
(2)以安全模式啟動 /usr/local/bin/mysqld_safe --skip-grant-table&
(3)進入mysql
#mysql mysql
#mysql>UPDATE user SET password=password('newpassword') WHERE user='root';
#mysql>quit
(4)重新再跑MySQL mysqladmin -uroot -p shutdown
相关阅读 更多 +