天天看點

windows 下mysql出現Access denied for user 'root'@'localhost' (using password

環境:window7,tomcat6,!今天部署程式啟動的死後突然出現ccess denied for user 'root'@'localhost' (using password)這個錯誤,開始以為是程式的問題,後面才知道是mysql的問題,可是mysql用戶端工具還是能夠登入啊 ,我就納悶了!好了  疑惑不解就不說了!後面我就翻了幾篇文章,找到了:

就是運作了:

1:   到WINDOWS的指令行了(‘DOS’ 下),切換到你的MySQL bin目錄下:

mysqld  --defaults-file="C:\Program Files\MySQL\MySQL Server 5.1\my.ini" --console --skip-grant-tables;

     運作之後看到這樣的結果就說明好了:

        090515 22:06:09 [Warning] The syntax '--log' is deprecated and will be removed i

n MySQL 7.0. Please use '--general_log'/'--general_log_file' instead.

090515 22:06:09 [Warning] The syntax '--log_slow_queries' is deprecated and will

 be removed in MySQL 7.0. Please use '--slow_query_log'/'--slow_query_log_file'

instead.

090515 22:06:09 [Warning] The syntax '--log' is deprecated and will be removed i

n MySQL 7.0. Please use '--general_log'/'--general_log_file' instead.

090515 22:06:09 [Warning] The syntax '--log_slow_queries' is deprecated and will

 be removed in MySQL 7.0. Please use '--slow_query_log'/'--slow_query_log_file'

instead.

090515 22:06:09 [ERROR] The update log is no longer supported by MySQL in versio

n 5.0 and above. It is replaced by the binary log. Now starting MySQL with --log

-bin='' instead.

090515 22:06:09  InnoDB: Started; log sequence number 0 324221

090515 22:06:09 [Note] mysqld: ready for connections.

Version: '5.1.33-community-log'  socket: ''  port: 3306  MySQL Community Server

(GPL)

2:mysql -uroot mysql;  (這一步同樣需要切換到mysql安裝的bin目錄下執行

看到這樣的記過就說明好了:

  Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.1.33-community-log MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

好了 感謝文章中的【ACMAIN_CHM】  注意了

我執行了這兩句話,程式也不報那個錯誤了! 原文位址:http://bbs.csdn.net/topics/310006640

  注意原文提問者說的幾個解決辦法是linux下面的 ,windows下面的解決辦法 使用者[ACMAIN_CHM]回答了!注意一部一部的來!就寫這麼多吧

繼續閱讀