swazer_z

因为喜欢,所以追求...

修改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';

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 ;
阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。如有问题请联系swazer_z@126.com https://blog.csdn.net/swazer_z/article/details/51545483
个人分类: mysql
上一篇mysql 日期格式
下一篇MySQL服务器上添加一个允许远程访问的用户
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭