MySQL 5.6之innodb匯入的改進

來源:互聯網
上載者:User

MySQL 5.6之innodb匯入的改進

在MySQL 5.6之前,匯入單個innodb表的idb檔案需要對齊tablespace id,而如果tablespace id不一致,就需要通過在新庫不挺的建立表,來增長tablespace id,以致對齊tablespace id。

5.6版本之後

alter table ... import tablespace

已經不需要對齊tablespace id。

alter table ...for export

5.6增加了以上命令,可以使匯出的idb檔案保持一致狀態,並且組建檔案.cfg尾碼檔案。當我們需要單表複製的時候,直接拷貝.frm/.idb/.cfg檔案,然後直接執行

alter table ... import tablespace

即可匯入.

在5.6.8之後,可以不需要產生cfg檔案,直接複製idb檔案和結構檔案即可進行匯入!但是會產生如下警示:

Warning Code : 1810

InnoDB: IO Read error: (2, No such file or directory) Error opening './test/log_table_cube.cfg', will attempt to import without schema verification

注意,當對錶加上for export鎖定之後,複製完記得unlock tables釋放該鎖!

InnoDB儲存引擎的啟動、關閉與恢複

MySQL InnoDB獨立資料表空間的配置

MySQL Server 層和 InnoDB 引擎層 體繫結構圖

InnoDB 死結案例解析

MySQL Innodb獨立資料表空間的配置

本文永久更新連結地址:

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.