웹 및 클래식 호스팅 도움말

Why do I get a MySQL "error: 1016 Can't open file: ..."?

Errors such as: ..."Got error: 1016: Can't open file: 'YOUR_TABLE_NAME.MYI'. (error:145) when using LOCK TABLES"... (as well as numerous other noted below) are caused by MySQL table corruption. Table corruption can be caused by a variety of events, and will make some or all of a table unavailable.

Table corruption can also significantly decrease the performance of queries on effected tables. Table corruption can be be repaired by using the the REPAIR TABLE command.

For more information about the REPAIR TABLE command see:

MySQL 4.0, 4.1

http://dev.mysql.com/doc/refman/4.1/en/repair-table.html

MySQL5.0

http://dev.mysql.com/doc/refman/5.0/en/repair-table.html

Run REPAIR TABLE on an affected table

  1. Enter phpMyAdmin for the database you want to use. For more information, see Log in to phpMyAdmin.
  2. Click on the table name of the affected table.

    Note: If phpMyAdmin is unable to display the table information, or encounters errors loading the table details page, another option would be to use the SQL button at the top of the left frame to enter your own query. You can repair the table manually by issuing the command REPAIR TABLE in this SQL window.

  3. Click on the Operations tab at the top of the right panel.
  4. Click Repair table at the bottom of the right panel.

This command can take some time and will block some queries, such as inserts, to the table.

Warning: It is possible that the phpMyAdmin Web server will time out waiting for a response from this command. If this happens, do not issue it again. Use the processlist feature, and you'll likely see the REPAIR command still running. Wait for it to complete. On large tables, this can take hours.

Some other errors that may be caused by table corruption include:

  • Can't find file table.MYI.
  • Duplicate unique key or constraint on write or update.
  • Got error ERR from table handler. (ERR being a number).
  • Index file is crashed / Wrong file format.
  • No more room in index file.
  • No more room in record file.
  • Old database file.
  • Record file is crashed.
  • Record was already deleted (or record file crashed).
  • table.frm is locked against change.
  • Table is crashed and last repair failed.
  • Tables was marked as crashed and should be repaired.
  • Unexpected end of file.

이 글이 도움되었나요?
피드백을 보내주셔서 감사합니다. 고객 서비스 담당자에게 문의하시려면 지원 전화 번호 또는 위의 채팅 옵션을 이용하시기 바랍니다.
도와드릴 수 있어 기쁩니다! 더 도와 드릴 것이 있나요?
그것 유감스럽습니다. 혼동이 되었던 사항 또는 솔루션이 고객님의 문제를 해결하지 못했던 원인을 알려주세요.