Website Domain Registration and Website Hosting - Host a Website Tonight
GoWebsite.com provides Domain Registration
Website Hosting, On-Line Shopping Carts,
Blog Hosting, Email Accounts, Security Certificates,
Merchant Accounts & other Website Products.
Free setup! Speak with us anytime: (480) 624-2500

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. Log in to your Account Manager.
  2. Click Web Hosting.
  3. Next to the hosting account you want to use, click Launch.
  4. In the Databases section of the Hosting Control Center, click the icon for the type of database you want to manage. On this page, you can create new databases, delete databases, make changes to existing databases, or export databases.
  5. To access more advanced management functions, click Manage via... next to the database you want to export.
  6. Enter your username and password for your database.
  7. 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 <tablename> in this SQL window.

  8. Click on the Operations tab at the top of the right panel.
  9. 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.
Domain Registration Domain Registration
Pay less for website domain names. Register your own .com, .net or .org for as low as $10.00 per year. (Plus ICANN fee of 18¢ per domain.) A free Email Account is included.
Website Hosting Website Tonight
For as little as $3.89 per month you can build your Website online with Website Tonight using our easy to use professional templates.
Play Video - Demo
Shopping Cart Software Quick Shopping Cart
Build and run your own successful online store in minutes! You're just five easy steps away!
Play Video
Website Hosting Website Hosting
Everything you need to give your Website the high-performance home it deserves!  Protect transactions and customer data with a
SSL Certificate