Re: rescue Inno tables from an abandoned data directory?
- Date: Sun, 4 Dec 2016 15:57:33 +1100
- From: Jesper Wisborg Krogh <mysql@xxxxxxxxxx>
- Subject: Re: rescue Inno tables from an abandoned data directory?
On 4/12/2016 07:23, Martin Mueller wrote:
I abandoned a MySQL 5.22 database that quite suddenly andthat I wasn’t able to start up again. The data directory consists of a mix of ISAM and Inno tables. I was able to copy the ISAM tables into a new 5.6 version, and they work.
Assuming you mean 5.5.22 or 5.6.22, then sometimes you can recover a
table without partitions with its own .ibd file (file-per-table) using
the transportable tablespace features:
1. Install a fresh copy of 5.6
2. Create the table (using a normal CREATE TABLE statement). If you
don't know the table definition use mysqlfrm from MySQL Utilities
3. Discard the tablespace (ALTER TABLE <table_name> DISCARD TABLESPACE)
4. Copy the .ibd file (make sure you work with a copy) into the new 5.6
instance (e.g. for the table db1.t1 copy to <datadir>/db1/t1.ibd)
5. Import the tablespace (ALTER TABLE <table_name> IMPORT TABLESPACE)
There is also an example in
The import in step 5. will complain that there is no .cfg file from a
proper tablespace copy, but InnoDB will do a best effort to import it,
and I don't think I've seen it fail if the tablespace has been valid.
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql