1.创建用户 

create user 'username'@'localhost' identified by 'pwd'

2.修改访问权限

 在mysql数据下修改user表用户host为’%’

update user set host='%' where user='username'

3.修改密码

MYSQL8.0密码默认加密方式为 default_authentication_plugin=caching_sha2_password 所以会造成不兼容问题

alter user 'username'@'localhost' identified with mysql_native_password by 'newpwd'

4.修改操作权限

MYSQL 8.0不支持创建用户时授权,必须先创建,后授权

grant all privileges on *.* to 'username'@'%' with grant option;

 

版权声明:本文为yan7原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/yan7/p/9092151.html