Chinaunix首页 | 论坛 | 博客
  • 博客访问: 304757
  • 博文数量: 33
  • 博客积分: 586
  • 博客等级: 中士
  • 技术积分: 494
  • 用 户 组: 普通用户
  • 注册时间: 2012-09-27 14:05
个人简介

衡铁刚 1)2011-2013:Alibaba MySQL DBA 2)2014-至今: Alibaba 数据库PD

文章分类

全部博文(33)

文章存档

2016年(1)

2015年(10)

2013年(5)

2012年(17)

我的朋友

分类: Mysql/postgreSQL

2012-09-29 12:51:37

 --routines-R
Include stored routines (procedures and functions) for the dumped databases in the output. Use of this option requires theSELECT privilege for the mysql.proc table. The output generated by using --routines contains CREATE PROCEDUREand CREATE FUNCTION statements to re-create the routines. However, these statements do not include attributes such as the routine creation and modification timestamps. This means that when the routines are reloaded, they will be created with the timestamps equal to the reload time.

带-R参数的mysqldump出来的文件中会包含create procedure语句,在5.1上dump出来的文件 source到5.5上可能会报错 Cannot load from mysql.proc. The table is probably corrupted,dump出来的文件包含了mysql.proc表重建的语句,create procedure执行在mysql.proc表重建之前则不会报错,否则就会报错,测试结果如下:

实例版本

Mysql.proc表版本

Create procedure版本

Source结果

5.5

5.1

5.1

failure

5.5

5.5

5.1

success

5.1

5.1

5.1

success

5.1

5.5

5.1

failure


最终,取消线上环境备份脚本中-R参数,procedure信息只使用mysql.proc表数据记录以便恢复,然后执行mysql_upgrade即可
ps:
5.1 mysql.proccomment char(64)
5.5 mysql.proccomment text 
mysql_upgrade会升级char(64)--->text,其余字段都相同
阅读(7921) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:mysqlbinlog

给主人留下些什么吧!~~