1丶sudo cat /etc/mysql/debian.cnf
2、输入指令
mysql -u debian-sys-maint -p
password 输入ggP3ApnqVGFbSuHI (每个人的都不一样所以要执行第一个命令查询)
3、use mysql
打开mysql数据库
4、update mysql.user set authentication_string=password('root') where user='root' and Host ='localhost';
修改密码
5、update user set plugin="mysql_native_password";
flush privileges;