1. 开窗口1: D:\program\phpstudy_pro\Extensions\MySQL5.7.26\bin>mysqld.exe --skip-grant-tables
2. 开窗口2:
mysqld.exe --skip-grant-tables; 直接回车
mysql> update user set authentication_string=PASSWORD('root123') where user='root';
mysql> flush privileges;
mysql> exit;
这样就把密码改为root123了。2022/7/27
D:\program\phpstudy_pro\Extensions\MySQL5.7.26\bin>mysql -uroot -p
Enter password: *******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 17
Server version: 5.7.26 MySQL Community Server (GPL)
或是用phpMyAdmin来管理:
http://localhost/phpMyAdmin4.8.5/index.php