use mysql;
update user set authentication_string=password("你的密码") where user='root'; #(无password字段的版本,也就是版本<=5.7的)
update user set password=password('你的密码') where user='root'; #(有password字段的版本,版本>5.7的)
update user set plugin="mysql_native_password";
flush privileges;
exit;
重启服务: service mysqld restart
参考:https://www.cnblogs.com/youpeng/p/11905051.html
扫描二维码关注公众号,回复:
12223160 查看本文章