MySQL procedure drop权限问题

Posted geek_ace

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySQL procedure drop权限问题相关的知识,希望对你有一定的参考价值。

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.

以上是关于MySQL procedure drop权限问题的主要内容,如果未能解决你的问题,请参考以下文章

MySQL的权限都有哪些

mysql 遍历所有表并条件查询

MySQL设置3权分立

mysql5.7数据库删除用户及其权限 drop user ‘root‘@‘%‘; flush privileges;

提权系列----Windows Service 服务器提权初识与exp提权,mysql提权

MySQL进阶19--函数的创建(举例)/设置mysql的创建函数的权限/查看(show)/删除(drop) / 举4个栗子