mysql8.0 用户授权

create user 'user-xxx'@'%' identified by 'passworddddd';
grant all privileges on *.* to 'user-xxx'@'%' with grant option;
ALTER USER 'user-xxx'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的数据库密码';
flush privileges;

#收回权限(不包含赋权权限)
REVOKE ALL PRIVILEGES ON *.* FROM user_name;
REVOKE ALL PRIVILEGES ON user_name.* FROM user_name;
#收回赋权权限
REVOKE GRANT OPTION ON *.* FROM user_name;
flush privileges;


------------------------------------------------------------------------------------------------------------
Navicat连接mysql8.0
2059 - Authentication plugin 'caching_sha2_password' cannot be loaded:xxxx

#登录
mysql -uroot -ppassword
use mysql;

# 注意:如果是远程连接,请将'localhost'换成'%'
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的数据库密码';

FLUSH PRIVILEGES;

posted @ 2022-10-10 13:56  walkersss  阅读(67)  评论(0编辑  收藏  举报