服务器在存取控制的两个阶段使用mysql数据库中的user、db和host表,这些授权表中的列如下:
表名 |
user |
db |
host |
列范围 |
Host |
Host |
Host |
|
User |
Db |
Db |
|
Password |
User |
|
权限列 |
Select_priv |
Select_priv |
Select_priv |
|
Insert_priv |
Insert_priv |
Insert_priv |
|
Update_priv |
Update_priv |
Update_priv |
|
Delete_priv |
Delete_priv |
Delete_priv |
|
Index_priv |
Index_priv |
Index_priv |
|
Alter_priv |
Alter_priv |
Alter_priv |
|
Create_priv |
Create_priv |
Create_priv |
|
Drop_priv |
Drop_priv |
Drop_priv |
|
Grant_priv |
Grant_priv |
Grant_priv |
|
Create_view_priv |
Create_view_priv |
Create_view_priv |
|
Show_view_priv |
Show_view_priv |
Show_view_priv |
|
Create_routine_priv |
Create_routine_priv |
|
|
Alter_routine_priv |
Alter_routine_priv |
|
|
References_priv |
References_priv |
References_priv |
|
Reload_priv |
|
|
|
Shutdown_priv |
|
|
|
Process_priv |
|
|
|
File_priv |
|
|
|
Show_db_priv |
|
|
|
Super_priv |
|
|
|
Create_tmp_table_priv |
Create_tmp_table_priv |
Create_tmp_table_priv |
|
Lock_tables_priv |
Lock_tables_priv |
Lock_tables_priv |
|
Execute_priv |
|
|
|
Repl_slave_priv |
|
|
|
Repl_client_priv |
|
|
安全列 |
ssl_type |
|
|
|
ssl_cipher |
|
|
|
x509_issuer |
|
|
|
x509_subject |
|
|
资源控制列 |
max_questions |
|
|
|
max_updates |
|
|
|
max_connections |
|
|
|
max_user_connections |
|
|
对存取控制的第二阶段(请求证实),服务器执行请求验证以确保每个客户端有充分的权限满足各需求。除了user、db和host授权表,如果请求涉及表,服务器可以另外参考tables_priv和columns_priv表。tables_priv和columns_priv表可以对表和列提供更精确的权限控制。这些表的列如下:
表名 |
tables_priv |
columns_priv |
范围列 |
Host |
Host |
|
Db |
Db |
|
User |
User |
|
Table_name |
Table_name |
|
|
Column_name |
权限列 |
Table_priv |
Column_priv |
|
Column_priv |
|
其它列 |
Timestamp |
Timestamp |
|
Grantor |
|
Timestamp和Grantor列当前还未使用,这儿不再进一步讨论。
为了对涉及保存程序的请求进行验证,服务器将查阅procs_priv表。该表具有以下列:
表名 |
procs_priv |
范围列 |
Host |
|
Db |
|
User |
|
Routine_name |
|
Routine_type |
权限列 |
Proc_priv |
其它列 |
Timestamp |
|
Grantor |
Routine_type列为ENUM列,值为'FUNCTION'或'PROCEDURE',表示行所指的程序类型。该列允许为同名函数和程序单独授权。
欢迎光临 PHP开发笔记 (http://phpvi.com/) | Powered by Discuz! 6.1.0 |