Heim >Datenbank >MySQL-Tutorial >mysql M/S不同步存储过程?

mysql M/S不同步存储过程?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 15:12:351045Durchsuche

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入 遇到一个mysql slave不同步procedure的问题。 在slave上查看mysql show procedure status where Name = 'test' \G;没有任何信息,奇怪mysql 5.0以上才有的存储过程,按理应该是能自动同步的。正常情

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入

  遇到一个mysql slave不同步procedure的问题。

  在slave上查看mysql> show procedure status where Name = 'test' \G;没有任何信息,奇怪mysql 5.0以上才有的存储过程,按理应该是能自动同步的。正常情况如下mysql> show procedure status where Name = 'test' \G;*************************** 1. row *************************** Db: test Name: test Type: PROCEDURE Definer: root@localhost Modified: ……

  Created: ……

  Security_type: DEFINER Comment:binlog记录# mysqlbinlog mysql-bin.000056|grep -i procedure drop procedure if exists mappingProc;CREATE DEFINER=`root`@`localhost` PROCEDURE `mappingProc`(out cnt int)

  ==========================================现在需要手动处理了,mysqldump ――no-data ――no-create-info xxx >xxx.sql然后在slave执行sql即可==================补充dump的时候mysqldump -R ――trigger ――single-transaction  xxx >xxx.sql其中,-d 表示――no-create-db, -n表示――no-data, -t表示――no-create-info, -R表示导出function和procedure.所以上述代码表示仅仅导出函数和存储过程,不导出表结构和数据。但是,这样导出的内容里,包含了trigger.再往mysql中导入时就会出问题,错误如下:error 1235 (42000) at line **: this version of mysql doesn't yet support 'multiple triggers with the same action time and event for one table'所以在导出时需要把trigger关闭。代码为mysqldump -u 数据库用户名 -p -n -t -d -r ――triggers=false 数据库名 > 文件名

mysql M/S不同步存储过程?

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn