發表文章

目前顯示的是 1月 12, 2012的文章

如果,你不小心忘記Mysql的root密碼....

是的,阿批又來了,因為阿批又把root密碼忘記了,會忘記的原因,主要是因為腦海裡的橡皮擦持續擴大了(迷之音:好像不是甚麼值得慶祝的事.... 廢話不多說,阿批來教大家解決方法,很好用唷,快偷學起來 :D 阿批是在Linux平台底下工作,所以已Linux來說明,(只要你是用Mysql,應該沒有Linux版本問題,當然Unix也通唷!) 1.關閉你的mysql(因為這樣你才可以修改&儲存它的設定檔) # service mysqld stop 2.修改MySQL的登入設定: # ee /etc/my.cnf 在[mysqld]裡加入 skip-grant-tables,這是讓你跳過驗證密碼的程序來進入mysql,接著就儲存&離開嚕。 3.啟動mysqld # service mysqld start 4.登入並修改MySQL的root密码 # /usr/bin/mysql 此時會出現如下訊息: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 to server version: 3.23.56 Type 'help;' or '\h' for help. Type '\c' to clear the buffer. 接著我們切換到mysql儲存帳密的資料庫mysql mysql> USE mysql ; 您會再看到另一個訊息: Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed 這時候您就可以大肆(!?)的修改root密碼了! mysql> UPDATE user SET Password = password ( '填入你的新密碼' ) WHERE User = 'root' ; 輸入上面的指令後按下Enter,就 匯出下如下的...