小编典典
我有解决办法!
在步骤2)重置root密码时,还将auth插件更改为mysql_native_password:
use mysql;
update user set authentication_string=PASSWORD("") where User='root';
update user set plugin="mysql_native_password" where User='root'; # THIS LINE
flush privileges;
quit;
这使我能够成功登录!
完整代码解决方案
1.运行bash命令
1.首先,运行以下bash命令
sudo /etc/init.d/mysql stop # stop mysql service
sudo mysqld_safe --skip-grant-tables & # start mysql without password
# enter -> go
mysql -uroot # connect to mysql
2.然后运行mysql命令=>将其手动复制粘贴到cli
use mysql; # use mysql table
update user set authentication_string=PASSWORD("") where User='root'; # update password to nothing
update user set plugin="mysql_native_password" w