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;
