FreeBSD mysql 忘記密碼 mysqld_safe 安裝模式重設密碼。

如果忘記 MySQL root 密碼,可用下面方式重新設定

MySQL 服務停止,再以安全模式啟動

<span style="color: #3366ff;">killall mysqld</span>
<span style="color: #3366ff;">/usr/local/bin/mysqld_safe -u root --skip-grant-tables &amp; mysql</span>

重新 MySQL 設定 root 密碼

<span style="color: #3366ff;">&gt;use mysql</span>
<span style="color: #3366ff;"> &gt;UPDATE user SET password=password('new password') where user='root';</span>
<span style="color: #3366ff;"> &gt;FLUSH PRIVILEGES;</span>

請小心使用!!

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s