权限问题

opsusr用户能执行drop procedure的单子;不能执行drop table的单子。

查看操作用户权限

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER on *.* to 'opsusr'@'xxxx';

没drop权限,但是为什么能drop procedure呢?

文档

The ALTER ROUTINE privilege is needed to alter or drop stored routines (procedures and functions).

原来drop procedure的权限包含在alter routines里面了,alter routines包含alter以及drop存储过程和函数的权限,drop包含的是drop db,table,view权限

另:truncate table也需要drop 权限

The DROP privilege enables you to drop (remove) existing databases, tables, and views. The DROP privilege is required in order to use the statement ALTER TABLE ... DROP PARTITION on a partitioned table. The DROP privilege is also required for TRUNCATE TABLE. If you grant the DROP privilege for the mysql database to a user, that user can drop the database in which the MySQL access privileges are stored.

posted @ 2018-07-19 14:02  geek_ace  阅读(161)  评论(0编辑  收藏  举报