limit_action.md 538 字节
Newer Older
M
Mars Liu 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
# 限制用户使用资源

Joe 需要限制数据分析组(role analysis)的用户, 每小时查询次数不能超过10000次。应该怎么操作?

## 答案

```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;
```