IT序号网

mysql修改definer方法

flyfish 2021年06月14日 数据库 283 0

 -- 函数、存储过程

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=`root`@`%` SQL SECURITY DEFINER VIEW ",TABLE_SCHEMA,".",TABLE_NAME," as ",VIEW_DEFINITION,";") from information_schema.VIEWS where DEFINER<>'billing@%'; 
 
--触发器
select DEFINER from information_schema.TRIGGERS;

评论关闭
IT序号网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!