博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

#修改存储过程、函数、事件、触发器、视图的 DEFINER
select 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 
begin
insert 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 ;

版权声明:QQ:597507041