# 限制用户使用资源
Joe 需要限制数据分析组(role analysis)的用户, 每小时查询次数不能超过10000次。应该怎么操作?
点击进入[MySQL实战练习环境](https://mydev.csdn.net/product/pod/new?image=cimg-centos7-skilltreemysql&connect=auto&create=auto&utm_source=skill)。
* `show databases` 列出所有数据库
* `show tables` 列出所有表
## 答案
```mysql
alter user analysis with MAX_QUERIES_PER_HOUR 10000;
```
## 选项
### A
```mysql
set user analysis with MAX_QUERIES_PER_HOUR 10000;
```
### B
```mysql
alter role analysis with MAX_QUERIES_PER_HOUR 10000;
```
### C
```mysql
alter role analysis with MAX_QUERIES_PER_HOUR=10000;
```
### D
```mysql
alter user analysis set MAX_QUERIES_PER_HOUR 10000;
```