Where are table definitions stored in InnoDB data dictionary?

Where are table definitions stored in InnoDB data dictionary?

Information about table definitions is stored both in the .frm files, and in the InnoDB data dictionary. If you move .frm files around, or if the server crashes in the middle of a data dictionary operation, these sources of information can become inconsistent.

What happens if you delete a table in InnoDB?

Maybe you InnoDB: have deleted and recreated InnoDB data files but have forgotten InnoDB: to delete the corresponding .frm files of InnoDB tables? This means that there is an orphan .frm file without a corresponding table inside InnoDB.

What happens if the InnoDB data dictionary is out of sync?

A symptom of an out-of-sync data dictionary is that a CREATE TABLE statement fails. If this occurs, look in the server’s error log. If the log says that the table already exists inside the InnoDB internal data dictionary, you have an orphan table inside the InnoDB tablespace files that has no corresponding .frm file.

How to delete orphan.frm files in InnoDB?

Maybe you InnoDB: have deleted and recreated InnoDB data files but have forgotten InnoDB: to delete the corresponding .frm files of InnoDB tables? This means that there is an orphan .frm file without a corresponding table inside InnoDB. You can drop the orphan .frm file by deleting it manually.

Is there an orphan table in the InnoDB data dictionary?

If the log says that the table already exists inside the InnoDB internal data dictionary, you have an orphan table inside the InnoDB tablespace files that has no corresponding .frm file. The error message looks like this: InnoDB: Error: table test/parent already exists in InnoDB internal InnoDB: data dictionary.

Why is the InnoDB table still in MySQL?

InnoDB: This may also be a table created with CREATE TEMPORARY TABLE InnoDB: whose .ibd and .frm files MySQL automatically removed, but the InnoDB: table still exists in the InnoDB internal data dictionary. If this occurs, try the following procedure to resolve the problem: