Chinaunix首页 | 论坛 | 博客
  • 博客访问: 244222
  • 博文数量: 42
  • 博客积分: 1555
  • 博客等级: 上尉
  • 技术积分: 489
  • 用 户 组: 普通用户
  • 注册时间: 2006-09-10 13:58
文章分类

全部博文(42)

文章存档

2017年(1)

2015年(1)

2014年(1)

2013年(6)

2012年(12)

2011年(3)

2010年(3)

2009年(1)

2007年(7)

2006年(7)

我的朋友

分类: Mysql/postgreSQL

2013-12-30 11:35:10

 需要对一个生产库做一个repication,需要将master的数据导入到slave。个人觉得使用mysqldum在导入的时候比较费时(的确比较费时)
所以想偷懒,记录下master的index和position以后,直接将其数据库复制到datadir下面。启动数据库,show database 可以找到刚才复制
过来的数据库,但是在对其表进行查询的时间数据库说话了“你查询的xxx表不存在”。然后,show table ,那些表不活生生的在那里吗?怎么
就不存在呢。
 没有办法,只好去看日志了,日志表达如下: 
InnoDB: Error: table `dbname`.`tablename` does not exist in the InnoDB internal
InnoDB: data dictionary though MySQL is trying to drop it.
InnoDB: Have you copied the .frm file of the table to the
InnoDB: MySQL database directory from another database?
InnoDB: You can look for further help from
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html
 打开指定的页面看了看,没太怎么明白不过是说要我重建!重建当然行不通了,我还有数据呢。没有办法只能老老实实的使用mysqldump导出
再导入到slave吧。

场景:使用数copy的方式备份/还原数据库
现象: 查询的时候找不到表,数据库有上在的日志 
解决办法: 使用mysqldump 导出导入 
发生版本:5.6.15 
阅读(5320) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~