grant.md 699 字节
Newer Older
M
Mars Liu 已提交
1 2
# 授权

M
having  
Mars Liu 已提交
3
管理员要给用户 joe 授权,允许他查询 emplyee 表,应用哪一条语句?
M
Mars Liu 已提交
4

M
Mars Liu 已提交
5 6
点击进入[MySQL实战练习环境](https://mydev.csdn.net/product/pod/new?image=cimg-centos7-skilltreemysql&connect=auto&create=auto&utm_source=skill)

M
Mars Liu 已提交
7 8
## 答案

M
having  
Mars Liu 已提交
9 10
```mysql
grant select on table employee to joe;
M
Mars Liu 已提交
11 12 13 14 15 16
```

## 选项

### 权限名错误

M
having  
Mars Liu 已提交
17 18
```mysql
grant query on table employee to joe;
M
Mars Liu 已提交
19 20 21 22
```

### 权限名错误

M
having  
Mars Liu 已提交
23 24
```mysql
grant read on table employee to joe;
M
Mars Liu 已提交
25 26 27 28
```

### 操作关键词错误

M
having  
Mars Liu 已提交
29 30
```mysql
grant select on table employee of joe;
M
Mars Liu 已提交
31 32 33 34
```

### 操作错误

M
having  
Mars Liu 已提交
35 36
```mysql
grant select on table employee.* of joe;
M
Mars Liu 已提交
37 38 39 40
```

### 权限过高

M
having  
Mars Liu 已提交
41 42
```mysql
grant all on table employee to joe;
M
Mars Liu 已提交
43
```