MYSQL ERROR 1194 (HY000)

來源:互聯網
上載者:User

標籤:

作業系統檔案限制大小導致 MYSQL ERROR 1194 (HY000): Table is marked as crashed and should be repaired 問題處理

同事反饋應用在執行查詢某張表時候報ERROR 1194 (HY000): Table is marked as crashed and should be repaired 錯誤

mysql> select * from ims_stat_msg_history where module=‘basic‘ and message=‘0‘ and createtime>=UNIX_TIMESTAMP(‘2015-03-04‘) LIMIT 0, 10;ERROR 1194 (HY000): Table ‘ims_stat_msg_history‘ is marked as crashed and should be repaired

通過網路搜尋得出的大概問題原因為索引頁損壞或表出現錯誤,網路上提供2種解決方案

  • 使用myisamchk 命令進行修複 myisamchk -c -r /var/lib/mysql/wx/ims_stat_msg_history.

  • 使用mysql 命令 repair table ims_stat_msg_history 進行修複.

通過使用上面兩種解決方案,此問題依然存在,通過核查表發現表大小剛好為2G(1073741312/1024/1024)*2

-rw-rw----    1 mysql    mysql    1073741312 Mar 04 17:59 ims_stat_msg_history.MYD-rw-rw----    1 mysql    mysql     321451008 Mar 04 18:22 ims_stat_msg_history.MYI-rw-rw----    1 mysql    mysql          8937 Mar 28 2014  ims_stat_msg_history.frm

隨著這條線索核查作業系統的limit (/etc/security/limits) 發現default有設定fssize 為2097151 和檔案已經達到的大小2G剛好一致,這裡我將此參數改為-1 ,然後重新切換一下使用者環境後重啟mysql 
重啟mysql後,再次執行repair table ims_stat_msg_history進行修複,經過修複後測試,表恢複正常!

總結:
  • 對於網路上提供的解決方案,在不十分清楚的情況下,需要反覆確認操作,最好進行先備份

  • 對於使用了修複方案還是存在問題,需要多擴充思路和方向進行解決


MYSQL ERROR 1194 (HY000)

聯繫我們

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