隨筆-124  評論-194  文章-0  trackbacks-0

          轉自:這里

          我的系統是ubuntu6.06,最近新裝好的mysql在進入mysql工具時,總是有錯誤提示:
          # mysql -uroot -p
          Enter password:
          ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
          使用網上介紹的方法修改root用戶的密碼:
          # mysqladmin -uroot -p password 'newpassword'
          Enter password:
          mysqladmin: connect to server at 'localhost' failed
          error: 'Access denied for user 'root'@'localhost' (using password: YES)'
          現在終于被我找到了解決方法,如下(請先測試方法三,謝謝?。?br>方法一:
          # /etc/init.d/mysql stop
          # mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
          # mysql -u root mysql
          mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
          mysql> FLUSH PRIVILEGES;
          mysql> quit
          # /etc/init.d/mysql restart
          # mysql -uroot -p
          Enter password: <輸入新設的密碼newpassword>
          mysql>
          方法二:
          直接使用/etc/mysql/debian.cnf文件中[client]節提供的用戶名和密碼:
          # mysql -udebian-sys-maint -p
          Enter password: <輸入[client]節的密碼>
          mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
          mysql> FLUSH PRIVILEGES;
          mysql> quit
          # mysql -uroot -p
          Enter password: <輸入新設的密碼newpassword>
          mysql>
          方法三:
          這種方法我沒有進行過測試,因為我的root用戶默認密碼已經被我修改過了,那位有空測試一下,把結果告訴我,謝謝?。?br># mysql -uroot -p
          Enter password: <輸入/etc/mysql/debian.cnf文件中[client]節提供的密碼>
          至此,困惑多時的問題解決了!

          posted on 2007-11-18 12:19 我愛佳娃 閱讀(2946) 評論(1)  編輯  收藏 所屬分類: 服務配置

          評論:
          # re: DEBIAN下的MYSQL的ROOT密碼重設 2009-02-19 22:43 | fanzhiyong
          方法三,不行  回復  更多評論
            
          主站蜘蛛池模板: 濮阳市| 休宁县| 吉林市| 习水县| 临颍县| 吉林省| 青神县| 宜阳县| 荃湾区| 衡南县| 察哈| 康平县| 武功县| 新源县| 勃利县| 建阳市| 镇平县| 建宁县| 龙岩市| 通山县| 仁寿县| 兴宁市| 邵阳县| 盘锦市| 嫩江县| 定结县| 师宗县| 恩施市| 牡丹江市| 清水河县| 当雄县| 法库县| 石渠县| 大石桥市| 永德县| 阿拉善盟| 方城县| 永顺县| 石渠县| 乌兰县| 右玉县|