您的位置:首页 > 数据库 > MySQL

修改MySQL存储过程、函数、事件、触发器、视图的DEFINER

2015-09-11 09:26 731 查看
#修改存储过程、函数、事件、触发器、视图的 DEFINERselect definer from mysql.proc;update mysql.proc set definer='billing@%';
select DEFINER from mysql.EVENTS;update mysql.EVENTS set definer='billing@%';
select DEFINER from information_schema.VIEWS; select concat("alter DEFINER=`billing`@`%` SQL SECURITY DEFINER VIEW ",TABLE_SCHEMA,".",TABLE_NAME," as ",VIEW_DEFINITION,";") from information_schema.VIEWS where DEFINER<>'billing@%'; 
select DEFINER from information_schema.TRIGGERS;drop trigger upc.t_trigger1;
DELIMITER ;;CREATE DEFINER=`billing`@`%` trigger upc.t_trigger1 before delete on upc.sys_sequences   for each row begininsert into upc.sys_sequences_bak values(2,old.SEQUENCE_NAME,old.START_BY,old.INCREMENT_BY,old.LAST_NUMBER,old.JVM_STEP_BY,now());end;;DELIMITER ;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: