码迷,mamicode.com
首页 > 数据库 > 详细

MySQL procedure drop权限问题

时间:2018-07-19 14:56:02      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:enable   分享   red   alter   replica   为什么   one   ble   database   

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权限问题

标签:enable   分享   red   alter   replica   为什么   one   ble   database   

原文地址:https://www.cnblogs.com/geek-ace/p/9335500.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!