I am recovering a missing mysql db with tables and have the frm files and ibdata1.

I have used innodb_file_per_table to make each DB have its own data file and tests show that new DB now use this system when created.

I noticed that when I to view the newly imported frms and data or write any SQL against them, they aren't being found. Several 'views' are available, but no tables.

If I run check table sometablename, I get that the table doesn't exist. If I try to create a table with the same name, I get that the table already exists.

I have stopped and started the MYSQL service several times, hoping it would pick up the new frms, but nothing.

Any idea?

有帮助吗?

解决方案

You can't restore a database by simply loading in the contents of the database directory. InnoDB stores other information in some master files located in the main MySQL data directory.

The only reliable method of recovering all data is to either use a mysqldump and restore procedure, or to FLUSH WITH WRITE LOCK before copying the entire contents of the MySQL data directory. This method is not recommended for production systems as it locks the entire database for the duration of this operation.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top