修改MySQL存储过程、函数、事件、触发器、视图的DEFINER
2015-09-11 09:26
731 查看
#修改存储过程、函数、事件、触发器、视图的 DEFINERselect 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 begininsert 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 ;
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 begininsert 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多版本并发控制分析
- Mysql 索引概念及设计原则
- mysql复制原理
- MySQL HA方案
- 修改MySQL存储过程、函数、事件、触发器、视图的DEFINER
- Mysql数据表的优化
- MySQL工具汇总
- mysql导出存储过程、函数、视图、触发器
- mysqld异常重启后,自动启动应用srm进程
- 导出mysql表的部分记录
- 【转载】mysql权限管理
- MySQL InnoDB存储引擎详解
- mysql数据库安装
- mysqlrplms(实现mysql一主多从)工具
- 工作中使用的mysqldunp命令
- MySQL InnoDB小结
- mysqlbackup备份和还原
- MySQL技术内幕InnoDB存储引擎(表&索引算法和锁)
- mysql系统变量(下)
- mysqlbackup备份和还原