2011-07-16 62 views
1

我在mysql中遇到這個錯誤。我試圖修復它很多次,但仍然堅持。我還修好了所有的桌子。mysql錯誤的密鑰文件

morein_db/categories.MYI'; try to repair it 
110716 9:58:16 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './morein_db/categories.MYI'; try to repair it 
110716 9:58:16 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './morein_db/categories.MYI'; try to repair it 
110716 9:58:16 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './morein_db/products_stock.MYI'; try to repair it 
110716 9:58:16 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './morein_db/products_stock.MYI'; try to repair it 

110716 10:01:03 [ERROR] Got an error from thread_id=3586, /builddir/build/BUILD/mysql-5.5.10/storage/myisam/mi_write.c:222 

回答

1

關閉MySQL服務器,將目錄更改爲morein_db而在MySQL DATADIR和執行myisamchk的程序

myisamchk --silent --force --fast --update-state --key_buffer_size=64M --sort_buffer_size=64M --read_buffer_size=1M --write_buffer_size=1M *.MYI 

這裏假設你有超過64M的可用內存。如果增加這些緩衝區,修復速度會更快。您可以在這裏查看(非常方便)myisamchk工具的詳細信息: http://dev.mysql.com/doc/refman/5.6/en/myisamchk.html