解决方法:
在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