修改MySQL存儲過程、函數、事件、觸發器、視圖的DEFINER

修改存儲過程、函數、事件、觸發器、視圖的 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 ;

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章