Mysql 資料移轉後 啟動出錯,mysql遷移

來源:互聯網
上載者:User

Mysql 資料移轉後 啟動出錯,mysql遷移

今天上班後不知道為什麼,mysql一直無法啟動,折騰了半天於是決定重裝

我本地的伺服器用的是wamp , 重裝的時候, 要進行資料備份 , 我使用的最簡單粗暴的備份方式, 就是直接進入到mysql的安裝目錄下, 把data拷貝一份就可以了.


然後卸載wamp後重裝,資料移轉就是把data貼到相同位置替換下就ok了

但是今天遷移完後,mysql怎麼也啟動不了,查看log,顯示各種錯誤

2014-11-13 13:40:29 5196 [Note] Plugin 'FEDERATED' is disabled.
2014-11-13 13:40:29 5196 [Note] InnoDB: The InnoDB memory heap is disabled
2014-11-13 13:40:29 5196 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2014-11-13 13:40:29 5196 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-11-13 13:40:29 5196 [Note] InnoDB: Not using CPU crc32 instructions
2014-11-13 13:40:29 16e4  InnoDB: Error: unable to create temporary file; errno: 2
2014-11-13 13:40:29 5196 [ERROR] Plugin 'InnoDB' init function returned error.
2014-11-13 13:40:29 5196 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2014-11-13 13:40:29 5196 [ERROR] Unknown/unsupported storage engine: InnoDB
2014-11-13 13:40:29 5196 [ERROR] Aborting

查看各種資料後, 又有了粗獷的方式,刪除了data目錄下的除資料庫檔案夾以及ibdata1之外的檔案, 再重啟, ok了, 小綠表徵圖出來了,mysql正常啟動了。

*注意: 一定不要刪除ibdata1, 查了資料, 說這個是很重要的檔案,儲存著innodb相關的資料

當然,身為妹子的博主,自然有自己細心的一面, 為什麼刪除了其他檔案就可以啟動呢?



並且,在遷移過程中,妹紙做了各種測試.

1.僅替換data內的資料庫檔案夾,重啟後mysql可以啟動,但用navicat串連資料庫後無法開啟資料表,顯示資料表不存在  (即資料丟失, 上述ibdata1相關)

2.將事先備份的data內的資料庫檔案夾以及ibdata1替換到data目錄下,重啟, mysql無法啟動

3.將ib_logfile0以及ib_logfile1刪除, 重啟 , mysql啟動正常, 串連資料庫資料表資訊恢複.


大致搞懂了這三部分檔案的用途, 具體原因, 還待深究 , 日後補文.


相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.