• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

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

mysql 搞代码 4年前 (2022-01-09) 11次浏览 已收录 0个评论

欢迎进入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 mysq本文来源gaodai#ma#com搞*代#码9网#l 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 数据库名 > 文件名


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:mysql M/S不同步存储过程?
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址