直接学习:https://edu.csdn.net/course/play/27328/370705
忘记root用户密码的解决方案:
#1、解决方案如图:
#2、代码示例如下:
主窗口:
1、net stop mysql80;
2、mysqld --defaults-file=“C:\ProgramData\MySQL\MySQL Server 8.0\my.ini” --console --skip-grant-tables --shared-memory
7、ctrl +c
8、回车
9、net start mysql80
10、mysql -h localhost -u root -p
输入密码即可
新打开一个窗口:
3、mysql
4、flush privileges;
5、alter user ‘root’@‘localhost’ identified by ‘123456’;
6、exit