如何从 ibdata文件 恢复 MySQL 数据库
答案:2 悬赏:50
解决时间 2021-12-30 05:08
- 提问者网友:曖昧情执
- 2021-12-29 15:10
如何从 ibdata文件 恢复 MySQL 数据库
最佳答案
- 二级知识专家网友:24K纯糖
- 2021-12-29 16:49
已试过的方法:
1、停止MySQL服务
2、修改my.ini,在[mysql] 中追加 innodb_force_recovery=4 配置
3、启动MySQL服务,能正常启动服务,但数据库并没有恢复,完成的.err日志如下:
130205 16:01:26 [Note] Plugin 'FEDERATED' is disabled.
130205 16:01:26 InnoDB: The InnoDB memory heap is disabled
130205 16:01:26 InnoDB: Mutexes and rw_locks use Windows interlocked functions
130205 16:01:26 InnoDB: Compressed tables use zlib 1.2.3
130205 16:01:26 InnoDB: Initializing buffer pool, size = 554.0M
130205 16:01:26 InnoDB: Completed initialization of buffer pool
130205 16:01:26 InnoDB: highest supported file format is Barracuda.
130205 16:01:26 InnoDB: Waiting for the background threads to start
130205 16:01:27 InnoDB: 1.1.8 started; log sequence number 1595675
130205 16:01:27 InnoDB: !!! innodb_force_recovery is set to 4 !!!
130205 16:01:28 [Note] Event Scheduler: Loaded 0 events
130205 16:01:28 [Note] H:\MySQL Server\bin\mysqld: ready for connections.
Version: '5.5.22' socket: '' port: 3306 MySQL Community Server (GPL)
---------------------------------------------------------------------------------------------------
1、停止MySQL服务
2、修改my.ini,在[mysql] 中追加 innodb_force_recovery=4 配置
3、启动MySQL服务,能正常启动服务,但数据库并没有恢复,完成的.err日志如下:
130205 16:01:26 [Note] Plugin 'FEDERATED' is disabled.
130205 16:01:26 InnoDB: The InnoDB memory heap is disabled
130205 16:01:26 InnoDB: Mutexes and rw_locks use Windows interlocked functions
130205 16:01:26 InnoDB: Compressed tables use zlib 1.2.3
130205 16:01:26 InnoDB: Initializing buffer pool, size = 554.0M
130205 16:01:26 InnoDB: Completed initialization of buffer pool
130205 16:01:26 InnoDB: highest supported file format is Barracuda.
130205 16:01:26 InnoDB: Waiting for the background threads to start
130205 16:01:27 InnoDB: 1.1.8 started; log sequence number 1595675
130205 16:01:27 InnoDB: !!! innodb_force_recovery is set to 4 !!!
130205 16:01:28 [Note] Event Scheduler: Loaded 0 events
130205 16:01:28 [Note] H:\MySQL Server\bin\mysqld: ready for connections.
Version: '5.5.22' socket: '' port: 3306 MySQL Community Server (GPL)
---------------------------------------------------------------------------------------------------
全部回答
- 1楼网友:绝望伪装
- 2021-12-29 18:14
昨天,有个朋友对公司内部使用的一个mysql实例开启binlog,但是在启动的过程中失败了(他也没提,为何会失败),在启动失败后,他删除了ibdata1和ib_logfile,后来,能正常启动了,但所有的表通过show tables能看到,但是select的过程中却报“table doesn't exist”。
于是,建议他试试可传输表空间。
同时,自己也测试了下,确实可行。
测试版本 mysql 5.6.32 社区版
恢复的基本步骤
1. 将原来的数据文件copy到其它目录下。
2. 创建同名表,表结构必须保持一致。
3. 导出表空间
mysql> alter table t disca
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯