ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

解決方法:

在cmd裏面輸入mysql -u root -p就可以不用密碼登錄了,出現 password:的時候直接回車可以進入;


C:\Users\admin>mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 21
Server version: 5.7.17-log MySQL Community Server (GPL)


Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.


Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


mysql> use mysql;
Database changed
mysql> update user set password=password("123") where user="root";
ERROR 1054 (42S22): Unknown column 'password' in 'field list'
mysql> update user set password=password("123") where user="root";
ERROR 1054 (42S22): Unknown column 'password' in 'field list'
mysql> update user set authentication_string=password("123") where user="root";
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 1


mysql> flush privileges;
Query OK, 0 rows affected (0.02 sec)


mysql> quit;
Bye

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章