October 14, 2005

忘記 MySQL 的 root 密碼 >.<

年紀大了,忘了就是忘了,怎麼辦?

只要有系統管理員的權限都還有得救!

首先,用系統管理員的帳號登入,如 Linux 的 root 或 Windows 的 Administrator。

再來結束 mysql 的 process,Windows 叫出工作管理員,Linux 可以執行以下的指令:

killall mysqld

接下來,用以下的指令啟動並進入 MySQL:

mysqld -u root --skip-grant-tables &

mysql

進入 MySQL 的命令提示列後:

use mysql;
UPDATE user SET password=password('new password') where user='root';
FLUSH PRIVILEGES;

這樣就OK囉 ^^

由 tedyeng 發表於 October 14, 2005 10:23 PM
迴響
發表迴響









記住我的資訊?





請依上圖輸入檢核碼: