码迷,mamicode.com
首页 > 数据库 > 详细

MySQL 授权,回收权限,查看权限

时间:2018-06-28 14:03:48      阅读:247      评论:0      收藏:0      [点我收藏+]

标签:local   connect   级别   slist   time   obj   upd   ESS   TE   

show GRANTS for root@localhost;
flush privileges;
SHOW PROCESSLIST;

#全局授权,回收权限
GRANT ALL ON *.* TO ‘testzzq‘@‘localhost‘;
REVOKE ALL ON *.* FROM ‘testzzq‘@‘localhost‘;
flush privileges;

#数据库级别,授权,回收权限
GRANT ALL PRIVILEGES ON cs TO ‘testzzq‘@‘localhost‘;
REVOKE ALL PRIVILEGES ON cs FROM ‘testzzq‘@‘localhost‘;
flush privileges;

#数据库表级别,授权,回收权限
GRANT ALL PRIVILEGES ON cs.apply_reduction TO ‘testzzq‘@‘localhost‘ WITH MAX_QUERIES_PER_HOUR 2;
REVOKE ALL PRIVILEGES ON cs.apply_reduction FROM ‘testzzq‘@‘localhost‘;
flush privileges;


授权公式:
GRANT
priv_type [(column_list)]
[, priv_type [(column_list)]] ...
ON [object_type] priv_level
TO user [auth_option] [, user [auth_option]] ...
[REQUIRE {NONE | tls_option [[AND] tls_option] ...}]
[WITH {GRANT OPTION | resource_option} ...]

resource_option: {
| MAX_QUERIES_PER_HOUR count
| MAX_UPDATES_PER_HOUR count
| MAX_CONNECTIONS_PER_HOUR count
| MAX_USER_CONNECTIONS count
}

The number of queries an account can issue per hour
一个账号每小时可以发起查询操作的个数
The number of updates an account can issue per hour
一个账号每小时可以发起更新操作的个数
The number of times an account can connect to the server per hour
一个账号每小时可以连接服务器的次数
The number of simultaneous connections to the server by an account
一个账号同时可以连接服务器的个数,


#查看权限

show GRANTS for ‘testzzq‘@‘localhost‘

 

MySQL 授权,回收权限,查看权限

标签:local   connect   级别   slist   time   obj   upd   ESS   TE   

原文地址:https://www.cnblogs.com/anxbb/p/9237968.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!