请教:通过data文件夹恢复mysql数据库

horizonlyhw 2014-11-14 10:11:27
各位好,请教一个mysql恢复的问题。

我现在有data文件夹下的内容,怎么能恢复出来里面的数据呢?
我尝试了新建了一个库,把ibdata1 和 旧库对应的文件夹都放进去了,然后删除了ib_logfile*。 启动是成功了,表也都能看到了,但是一打开表,就会报错:incorrect information 或者 表不存在。

先谢了!
...全文
8908 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
haidao3467 2016-11-02
  • 打赏
  • 举报
回复
按照12楼做法 尽然成功了
qq_34164868 2016-08-03
  • 打赏
  • 举报
回复
mysql--1146--报错 先找到数据库存放地址,即Data文件夹(复制留下来) 再用电脑管家把所有的mysql卸载 然后把mysql文件夹弄走(卸载不会清掉它,需手动,一般在C:\ProgramData下)(可删除,或剪切走,以防万一) 重新安装mysql(我用的是mysql-installer-community-5.7.13.0程序包) 如果数据库启动了先关闭它(因为版本,关闭是(net stop mysql57--在cmd中);启动是(net start mysql57--在cmd中)) 然后把以前的数据库文件(自己需要的)(在Data文件夹下的,数据库名即文件夹名)复制到,新的数据库Data文件夹下(那些自带的数据库别动), 把新的Data下的那五个配置文件替换为以前老的文件(就是这五个文件auto.cnf,ib_buffer_pool,ib_logfile0,ib_logfile1,ibdata1) 重新启动数据库即可
horizonlyhw 2015-01-07
  • 打赏
  • 举报
回复
innodb确实是可以通过拷贝data文件夹进行恢复的,请参考:http://bbs.csdn.net/topics/390966560
九月茅桃 2014-11-26
  • 打赏
  • 举报
回复
引用 5 楼 horizonlyhw 的回复:
NDB的 是怎么恢复呢?
有备份的就能恢复,或者ndb如果有磁盘文件也可以恢复,如果没有,那就恢复不了。
九月茅桃 2014-11-26
  • 打赏
  • 举报
回复
引用 2 楼 horizonlyhw 的回复:
[quote=引用 1 楼 micropentium6 的回复:] ref: http://dev.mysql.com/doc/refman/5.0/en/innodb-backup.html this only works for innodb tables, see the data files that you need to have for restore...
您好,这个如果是ndb呢? 能行得通么?[/quote] ndb不行,ndb是存放在内存中的。
horizonlyhw 2014-11-26
  • 打赏
  • 举报
回复
别沉了 。
horizonlyhw 2014-11-21
  • 打赏
  • 举报
回复
引用 6 楼 rucypli 的回复:
尝试在配置文件中加入innodb_force_recovery=6来启动看是否可以读出数据
多谢版主参与,我试过了,还是不行。
horizonlyhw 2014-11-19
  • 打赏
  • 举报
回复
NDB的 是怎么恢复呢?
rucypli 2014-11-19
  • 打赏
  • 举报
回复
尝试在配置文件中加入innodb_force_recovery=6来启动看是否可以读出数据
pony520 2014-11-15
  • 打赏
  • 举报
回复
INNODB引擎不支持直接移库的,读出来会报错的 LSN不一样的
  • 打赏
  • 举报
回复
引用 2 楼 horizonlyhw 的回复:
[quote=引用 1 楼 micropentium6 的回复:] ref: http://dev.mysql.com/doc/refman/5.0/en/innodb-backup.html this only works for innodb tables, see the data files that you need to have for restore...
您好,这个如果是ndb呢? 能行得通么?[/quote] I don't know... do you have data files for all ndb nodes? Is this a recovery? where is ur backup?
horizonlyhw 2014-11-14
  • 打赏
  • 举报
回复
引用 1 楼 micropentium6 的回复:
ref: http://dev.mysql.com/doc/refman/5.0/en/innodb-backup.html this only works for innodb tables, see the data files that you need to have for restore...
您好,这个如果是ndb呢? 能行得通么?
  • 打赏
  • 举报
回复
ref: http://dev.mysql.com/doc/refman/5.0/en/innodb-backup.html this only works for innodb tables, see the data files that you need to have for restore...

56,677

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧