本文主要是介绍修改MySql的存储过程、函数、事件、触发器、视图的 DEFINER,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
#修改存储过程、函数、事件、触发器、视图的 DEFINER
select definer from mysql.proc;
update mysql.proc set definer='root@localhost';
or update mysql.proc set definer='root@localhost' where db='db_name';
or update mysql.proc set definer='root@localhost' where db='db_name';
select DEFINER from mysql.EVENTS;
update mysql.EVENTS set definer='root@localhost';
select DEFINER from information_schema.VIEWS;
select concat("alter DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW ",TABLE_SCHEMA,".",TABLE_NAME," as ",VIEW_DEFINITION,";") from information_schema.VIEWS where DEFINER='root@%';
select DEFINER from information_schema.TRIGGERS;
drop trigger upc.t_trigger1;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` 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 ;
这篇关于修改MySql的存储过程、函数、事件、触发器、视图的 DEFINER的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!