首页 > 数据库 >mysql8.0 用户授权

mysql8.0 用户授权

时间:2022-10-10 14:14:01浏览次数:56  
标签:REVOKE name PRIVILEGES 用户 mysql8.0 user mysql 授权 localhost

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;

标签:REVOKE,name,PRIVILEGES,用户,mysql8.0,user,mysql,授权,localhost
From: https://www.cnblogs.com/walkersss/p/16775485.html

相关文章