2014-02-11 104 views
0

我在Mac上工作時,它崩潰,硬盤損壞,不能修復,除非格式化,所以我恢復了我的DB數據從OS X,我得到了所有的文件夾,現在即時通訊我試圖恢復它在Windows電腦,而我修復的Mac。 我已經嘗試了幾個帖子,這裏說,我只需要將所有文件複製到Windows上的新MySQL分期付款的數據文件夾,我已經嘗試複製與frm文件和ind文件的db文件夾,然後我複製ibdata1文件,並重新啓動服務,但即使如此它沒有工作,我讀,我不得不復制ib_logfile0和ib_logfile1,所以我做了,但然後服務沒有想運行。當我恢復原始日誌它的工作原理但我只能看到mysqlworkbench中的表,但是我無法查詢它們,因爲日誌表示表格不存在,即使我可以看到它們。從* .frm文件恢復MySQL InnoDb

我在windows 7和mysqlworkbench上使用mysql 5.6。

目前我有* .frm文件,* .ibd文件,ibdata1,ib_logfiles0和1,我從我的os x hdd中拯救出來,我將它們全部複製到windows mysql安裝中,因此mysql服務不會啓動。 繼承人當前日誌,當我嘗試啓動服務。

FROM CARLOSDESKTOP.err: 

    2014-02-11 13:27:10 7108 Note Plugin 'FEDERATED' is disabled. 

      2014-02-11 13:27:10 3a8 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator. 

    2014-02-11 13:27:10 7108 Note InnoDB: Using atomics to ref count buffer pool pages 

    2014-02-11 13:27:10 7108 Note InnoDB: The InnoDB memory heap is disabled 

    2014-02-11 13:27:10 7108 Note InnoDB: Mutexes and rw_locks use Windows interlocked functions 

    2014-02-11 13:27:10 7108 Note InnoDB: Compressed tables use zlib 1.2.3 

    2014-02-11 13:27:10 7108 Note InnoDB: Not using CPU crc32 instructions 

    2014-02-11 13:27:10 7108 Note InnoDB: Initializing buffer pool, size = 8.0M 

    2014-02-11 13:27:10 7108 Note InnoDB: Completed initialization of buffer pool 

    2014-02-11 13:27:10 7108 Note InnoDB: Highest supported file format is Barracuda. 

2014-02-11 13:27:12 - Server start done. 

2014-02-11 13:27:12 - Status check of service 'MySQL56' returned start pending 

2014-02-11 13:47:27 - Status check of service 'MySQL56' returned stopped 



FROM CARLOSDESKTOP.err: 

    2014-02-11 13:27:12 7108 Note InnoDB: The log sequence numbers 8610473 and 8610473 in ibdata files do not match the log sequence number 13883013 in the ib_logfiles! 

    2014-02-11 13:27:12 7108 Note InnoDB: Database was not shutdown normally! 

    2014-02-11 13:27:12 7108 Note InnoDB: Starting crash recovery. 

    2014-02-11 13:27:12 7108 Note InnoDB: Reading tablespace information from the .ibd files... 

    2014-02-11 13:27:13 7108 ERROR InnoDB: space header page consists of zero bytes in tablespace .\demo\record.ibd (table demo/record) 

    2014-02-11 13:27:13 7108 Note InnoDB: Page size:1024 Pages to analyze:64 

    2014-02-11 13:27:13 7108 Note InnoDB: Page size: 1024, Possible space_id count:0 

    2014-02-11 13:27:13 7108 Note InnoDB: Page size:2048 Pages to analyze:64 

    2014-02-11 13:27:13 7108 Note InnoDB: Page size: 2048, Possible space_id count:0 

    2014-02-11 13:27:13 7108 Note InnoDB: Page size:4096 Pages to analyze:32 

    2014-02-11 13:27:13 7108 Note InnoDB: Page size: 4096, Possible space_id count:0 

    2014-02-11 13:27:13 7108 Note InnoDB: Page size:8192 Pages to analyze:16 

    2014-02-11 13:27:13 7108 Note InnoDB: Page size: 8192, Possible space_id count:0 

    2014-02-11 13:27:13 7108 Note InnoDB: Page size:16384 Pages to analyze:8 

    2014-02-11 13:27:13 7108 Note InnoDB: Page size: 16384, Possible space_id count:0 

      InnoDB: Error: could not open single-table tablespace file .\demo\record.ibd 

      InnoDB: We do not continue the crash recovery, because the table may become 

      InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it. 

      InnoDB: To fix the problem and start mysqld: 

      InnoDB: 1) If there is a permission problem in the file and mysqld cannot 

      InnoDB: open the file, you should modify the permissions. 

      InnoDB: 2) If the table is not needed, or you can restore it from a backup, 

      InnoDB: then you can remove the .ibd file, and InnoDB will do a normal 

      InnoDB: crash recovery and ignore that table. 

      InnoDB: 3) If the file system or the disk is broken, and you cannot remove 

      InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf 

      InnoDB: and force InnoDB to continue crash recovery here. 

2014-02-11 13:47:28 - Status check of service 'MySQL56' returned stopped 

2014-02-11 13:47:28 - Starting server... 

2014-02-11 13:48:29 - Status check of service 'MySQL56' returned start pending 

2014-02-11 13:48:29 - Server start done. 

2014-02-11 13:48:30 - Status check of service 'MySQL56' returned start pending 
+0

這個問題屬於dba或超級用戶。 – DanFromGermany

回答

2

從備份還原數據庫(我希望備份正常拍攝),你至少需要這些文件

  1. ibdata1中(和ibdata2,ibdataX如果它們被定義)
  2. 數據庫目錄帶* .ibd和* .frm文件

如果您在Workbench中看到表,那麼您只複製了.ibd和.frm文件。 ibdata1看起來是空的,因爲這是InnoDB保留表字典的地方。