1. 程式人生 > >Access denied for user 'root'@'IP' (using password:YES)解決方法

Access denied for user 'root'@'IP' (using password:YES)解決方法

all del socket sock please pla light sql 解決

在MySql的使用過程中,碰到“Access denied for user ‘root‘@‘IP‘ (using password:YES)”的問題,使用以下語句修改後還是不行。

GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘password‘ WITH GRANT OPTION;   
FLUSH PRIVILEGES; 
最後是通過以下步驟修改就不報錯了。

1、開始 → 搜索欄裏面輸入cmd → 右鍵cmd.exe選擇以管理員的身份運行

2、輸入net stop mysql

停止MySQL服務

3、輸入命令行來到mysql的bin目錄下,輸入下列粗體命令

  D:\MySQL\bin>mysqld --defaults-file="D:\MySQL\my.ini" --console --skip-grant-tables

  等一下,顯示出以下結果說明MySQL啟動:

  170215 22:26:09 [Warning] The syntax ‘--log‘ is deprecated and will be removed inMySQL 7.0. Please use ‘--general_log‘/‘--general_log_file‘ instead.

  170215 22:26: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.
  170215 22:26:09 [Warning] The syntax ‘--log‘ is deprecated and will be removed in MySQL 7.0. Please use ‘--general_log‘/‘--general_log_file‘ instead.
  170215 22:26: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.
  170215 22:26:09 [ERROR] The update log is no longer supported by MySQL in version 5.0 and above. It is replaced by the binary log. Now starting MySQL with --log-bin=‘‘ instead.
  170215 22:26:09 InnoDB: Started; log sequence number 0 324221
  170215 22:26:09 [Note] mysqld: ready for connections.Version: ‘5.1.33-community-log‘ socket: ‘‘ port: 3306 MySQL Community Server (GPL)

4、再以管理員的身份打開一個cmd.exe,輸入命令行來到mysql的bin目錄下,輸入:mysql -uroot mysql

5、進入mysql之後,輸入命令行修改密碼:

mysql>update user set authentication_string=password(‘123456‘) where user=‘root‘;

6、刷新權限:mysql>flush privileges;

7、退出mysql:mysql> quit;

Access denied for user 'root'@'IP' (using password:YES)解決方法