資料庫表損壞的修復

2021-08-25 04:52:46 字數 792 閱讀 3242

load() - dbd::mysql::st execute failed: table './test/test_user' is marked as crashed and last (automatic?) repair failed at /usr/local/share/perl/5.10.0/rose/db/object.pm line 385.

用命令列訪問出現:

error 145 (hy000): table './test/tst_user' is marked as crashed and should be repaired 開始時使用myisamchk -r -o /home/test/test_user.myi進行修復,出現錯誤:myisamchk: error: myisam_sort_buffer_size is too small。

df發現是mysql temp目錄太小,此錶太大。更改my.cnf檔案修改temp路徑到空間足夠的資料夾。

再次執行 myisamchk -r -o /home/test/test_user.myi,顯示錯誤:

myisamchk: error: can't create new tempfile: '/home/test/test_user.***' myisamchk: unknown error 126 myisamchk: error: 126 when reading last record 不得已,強制執行:myisamchk -r -o -f /home/test/test_user.myi

這次myisamchk一條條記錄檢查並修復,幾百萬條記錄用了幾個小時,最後這個表終於修復了。

資料庫表損壞的修復

用命令列訪問出現 開始時使用myisamchk r o home test test user.myi進行修復,出現錯誤 myisamchk error myisam sort buffer size is too small。df發現是mysql temp目錄太小,此錶太大。更改my.cnf檔案修...

SQLite資料庫損壞修復

the database disk image is malformed 進入到sqlite3操作指定的資料庫 或者直接 sqlite3 e item.db 操作此資料庫 sqlite databases main e item.db sqlite tables 顯示列表 檢查資料庫是否損壞 sql...

Mysql資料庫表被損壞後的修復

最近線上執行的專案突然資料庫出錯,某一張表不知道什麼原因已經崩潰,提示需要去修復,經過各種修復方法,最終實現 步驟 1.sql語句 check table tabtest 如果出現的結果說status是ok,則不用修復,如果有error則需要修復 2.linux執行 sql語句 repair tab...