mysql磁盘文件被损坏,无法启动,能看到data文件,在没有备份的话如何复原?
情景1:知道数据库中的表结构
1、先执行表结构语句
2、解除绑定
alter table `表1` discard tablespace;
alter table `表2` discard tablespace;
......
此时当前数据库下所有的.idb文件都会被删除,也就是只剩下表结构,原表数据被删除
…
3、导入 .idb文件现有数据库
也就是添加表数据,不过,目前还没有绑定
alter table `表1` import tablespace;
alter table `表2` import tablespace;
......