關(guān)于mysql create routine 權(quán)限的一些說明
1、如果用戶有create routine 權(quán)限那么他就可以創(chuàng)建procedure | function 。
2、如果用戶創(chuàng)建了procedure | function 那么mysql 會自動賦予它對procedure | function 的alter routine和execute 權(quán)限。
3、例子:
用戶root用戶創(chuàng)建一個spuser@'localhost'用戶并對它賦予create procedure 權(quán)限
grant create routine on tempdb.* to spuser@'localhost' identified by '123456';
用spuser@'localhost'用戶去創(chuàng)建一個routine
delimiter go create procedure sp_hello_world() begin select 'hello world'; end go delimiter ;
再一次查看spuser@'localhost'的權(quán)限
mysql> show grants; +---------------------------------------------------------------------------------------------------------------+ | Grants for spuser@localhost | +---------------------------------------------------------------------------------------------------------------+ | GRANT USAGE ON *.* TO 'spuser'@'localhost' IDENTIFIED BY PASSWORD '*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9' | | GRANT CREATE ROUTINE ON `tempdb`.* TO 'spuser'@'localhost' | | GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `tempdb`.`sp_hello_world` TO 'spuser'@'localhost' | +---------------------------------------------------------------------------------------------------------------+
以上這篇關(guān)于mysql create routine 權(quán)限的一些說明就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持本站。
版權(quán)聲明:本站文章來源標注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請保持原文完整并注明來源及原文鏈接。禁止復制或仿造本網(wǎng)站,禁止在非maisonbaluchon.cn所屬的服務(wù)器上建立鏡像,否則將依法追究法律責任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學習參考,不代表本站立場,如有內(nèi)容涉嫌侵權(quán),請聯(lián)系alex-e#qq.com處理。
關(guān)注官方微信