mysql遷移報錯

來源:互聯網
上載者:User

標籤:mysql

將mysql目錄直接拷貝遷移,過程不詳述,資料庫正常啟動,但是不能正常使用,select查表報表不存在,然後發現日誌報錯如下

InnoDB: Doing recovery: scanned up to log sequence number 265335480935

170504 15:56:39  InnoDB: Error: page 311313 log sequence number 265338125392

InnoDB: is in the future! Current system log sequence number 265335480935.

InnoDB: Your database may be corrupt or you may have copied the InnoDB

InnoDB: tablespace but not the InnoDB log files


解決辦法:

在/etc/my.cnf檔案的[mysqld]下添加

innodb_force_recovery = 4


重啟mysqld恢複正常,問題解決,記得之後將“innodb_force_recovery = 4”刪掉再重啟一次,否則還會出現問題


關於innodb_force_recovery的一些說明

innodb_force_recovery可以設定為1-6,大的數字包含前面所有數位影響。

  1. (SRV_FORCE_IGNORE_CORRUPT):忽略檢查到的corrupt頁。

  2. (SRV_FORCE_NO_BACKGROUND):阻止主線程的運行,如主線程需要執行full purge操作,會導致crash。

  3. (SRV_FORCE_NO_TRX_UNDO):不執行交易回復操作。

  4. (SRV_FORCE_NO_IBUF_MERGE):不執行插入緩衝的合併作業。

  5. (SRV_FORCE_NO_UNDO_LOG_SCAN):不查看重做日誌,InnoDB儲存引擎會將未提交的事務視為已提交。

  6. (SRV_FORCE_NO_LOG_REDO):不執行前滾的操作。



mysql遷移報錯

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.