mysql中表檔案或索引檔案損壞的處理

來源:互聯網
上載者:User

mysql中表檔案或索引檔案損壞,對該表進行操作時會出現錯誤號碼為144,145的錯誤。該錯誤可以通過以下辦法修複:

  (1)mysql命令列下用repair table table_name進行修改;

  (2)在程式中修複該問題,執行repair table table_name進行修複。但是這種情況下修複需要注意的地方,和其它的sql語句不要在同一個connection中執行,否則在執行該語句後,執行其他的sql語句可能會出錯。

  在執行該語句的前後都重新開啟connection就可以解決了(close_connection(); open_connection(); exec_sql(); close_connection(); open_connection()即可。有可能只要在執行這個語句之後重新開啟connection也可以,不過這個沒有實驗)。

相關文章

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.