D:\Program Files (x86)\Mysql5.7\MysqlServer5.7\bin>net start mysql MySQL 服务正在启动 . MySQL 服务已经启动成功。
D:\Program Files (x86)\Mysql5.7\MysqlServer5.7\bin>mysql -u root -p Enter password:(注释:直接回车) Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.7.19MySQL Community Server(GPL) Copyright (c) 2000, 2017, 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 authentication_string = password('root'), password_expired = 'N', password_last_changed = now() where user = 'root'; Query OK, 1 row affected, 1 warning (0.02 sec) Rows matched: 1 Changed: 1 Warnings: 1