MySQL Forums
Forum List  »  InnoDB

Re: Can't open file ****.ibd (errno: 1)
Posted by: Heikki Tuuri
Date: November 04, 2005 10:27AM

Christopher,

if you are not using the [mysqld] option

innodb_file_per_table

then an InnoDB table consists of

1) the .frm file in the database directory,
2) the table data dictionary entry and data in the ibdata files.

If 1) is missing, you can create the table in some other database, and copy the .frm file from there.

If 2) is missing, you can simply delete the .frm file manually.

After this, you are in a consistent state.

---

If you are using

innodb_file_per_table

then an InnoDB table consists of:

1) the .frm file in the database directory,
2) data dictionary entry in the ibdata files,
3) the .ibd file.

If MySQL complains it can't open file x.ibd, that means either 2) or 3) or both are missing. You should look into the .err log of mysqld to determine which is the case.

If 1) is missing, do like above.

If 2) is missing, then simply delete the .frm file manually (and also the .ibd file if that one exists).

If 3) is missing, you should upgrade to a recent 4.1.xx or 5.0.xx version, and simply DROP the table. Earlier versions had the problem that if you did not have the option

no-auto-rehash

in the [mysql] section of your my.cnf, then dropping a table with a missing .ibd file did not work.

I think we should add these detailed instructions to the manual.

Best regards,

Heikki
Oracle Corp./Innobase Oy
InnoDB - transactions, row level locking, and foreign keys for MySQL

InnoDB Hot Backup - a hot backup tool for InnoDB which also backs up MyISAM tables
http://www.innodb.com/order.php

Options: ReplyQuote


Subject
Views
Written By
Posted
13744
July 12, 2005 05:02PM
Re: Can't open file ****.ibd (errno: 1)
24314
November 04, 2005 10:27AM
3637
February 02, 2007 08:41AM
4404
January 08, 2008 04:13AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.