MySQL不需要密码就能登录问题

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 查看本文章

猜你喜欢

转载自blog.csdn.net/zwx_lucky/article/details/107408617