MySQL-用户权限详解[未完成]

MySQL用户权限相关操作

授权

GRANT SELECT ON datbase.* TO 'test'@'%';

刷新权限

FLUSH PRIVILEGES;

DML(数据库操作用语言):

权限 注释
Update 更新现有行
Delete 删除现有行
Insert 将数据插入表中

DQL(数据库查询语言)

权限 注释
Select 从表中查询现有行

DDL(数据库定义语言)

权限 注释
Alter 用来修改表
Alter routine 更改或删除存储的函数/过程
Create 创建新的数据库或表
Create routine 用来创建存储的函数/过程
Create view 创建新视图
Create temporary tables 创建临时表
Drop 删除数据库、表及视图
Show view To see views with SHOW CREATE VIEW
Index 创建或者删除索引
Event 创建,更改,删除和执行事件
Lock tables To use LOCK TABLES (together with SELECT privilege)
Show databases 查看所有数据库

DCL(数据库控制语言)

权限 注释
Create role 创建角色
Drop role 删除角色
Shutdown 停止数据库服务
Super 杀进程、设置全局变量执行change master
Reload 重新加载或刷新表,日志和权限
Replication client 询问从服务器或主服务器的位置
Replication slave 从主服务器读取二进制日志事件
Process To view the plain text of currently executing queries

未分类:

+----------------------------+---------------------------------------+-------------------------------------------------------+
| Privilege                  | Context                               | Comment                                               |
+----------------------------+---------------------------------------+-------------------------------------------------------+
| Execute                    | Functions,Procedures                  | To execute stored routines                            |
| File                       | File access on server                 | To read and write files on the server                 |
| Grant option               | Databases,Tables,Functions,Procedures | To give to other users those privileges you possess   |
| Proxy                      | Server Admin                          | To make proxy user possible                           |
| References                 | Databases,Tables                      | To have references on tables                          |
| Trigger                    | Tables                                | To use triggers                                       |
| Create tablespace          | Server Admin                          | To create/alter/drop tablespaces                      |
| Usage                      | Server Admin                          | No privileges - allow connect only                    |
| XA_RECOVER_ADMIN           | Server Admin                          |                                                       |
| SET_USER_ID                | Server Admin                          |                                                       |
| ROLE_ADMIN                 | Server Admin                          |                                                       |
| RESOURCE_GROUP_USER        | Server Admin                          |                                                       |
| RESOURCE_GROUP_ADMIN       | Server Admin                          |                                                       |
| BINLOG_ADMIN               | Server Admin                          |                                                       |
| SYSTEM_VARIABLES_ADMIN     | Server Admin                          |                                                       |
| GROUP_REPLICATION_ADMIN    | Server Admin                          |                                                       |
| CONNECTION_ADMIN           | Server Admin                          |                                                       |
| REPLICATION_SLAVE_ADMIN    | Server Admin                          |                                                       |
| ENCRYPTION_KEY_ADMIN       | Server Admin                          |                                                       |
| BACKUP_ADMIN               | Server Admin                          |                                                       |
| PERSIST_RO_VARIABLES_ADMIN | Server Admin                          |                                                       |
+----------------------------+---------------------------------------+-------------------------------------------------------+

相关信息:

八月MySQL之DDL、DML、DCL

点赞

发表评论

电子邮件地址不会被公开。 必填项已用*标注