mysql8.0 以后 在mysql的user表中的password字段变了,变成authentication_string;
另外还加了一个身份验证插件的字段plugin字段,值有caching_sha2_password,mysql_native_password,个人理解可以理解为密码的加密和缓存插件,一般情况下我们设置成mysql_native_password就可以。
1.进入mysql
2.use mysql
3.select host,user,plugin,authentication_string from user; 查看所有的用户和密码
4.alter user 'root'@'localhost' identified with 'mysql_native_password' by '123456';修改相应的密码
5.flush privileges;
网友评论