Mysql> show engines;
Mysql> ALTER TABLE T1 engine = InnoDB;
Mysql> ALTER TABLE t7 auto_increment = 100;
Mysql> Show Table status like "T6" \G;
Try to reply to a single table with the IDB file, and note that you want to revert to the original library:
1. Back Up IBD files:
# CP T7.ibd T7.ibd.bak
2. Delete table data:
Mysql> SELECT * from T7;
+-----+------+
| I | name |
+-----+------+
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| 6 | 1 |
| 7 | 2 |
| 8 | 3 |
| 100 | 1 |
| 101 | 2 |
| 102 | 3 |
+-----+------+
9 Rows in Set (0.00 sec)
Mysql> Delete from T7;
Query OK, 9 rows affected (0.07 sec)
Mysql> SELECT * from T7;
Empty Set (0.00 sec)
3. Correct identification of IBD files
Mysql> ALTER TABLE T7 discard Tablespace;
4. Reply to IBD files:
# MV T7.ibd.bak T7.IBD
# chown MySQL. T7.ibd
# chmod 660 T7.IBD
5. Correctly identify IBD files for manual replies
Mysql> ALTER TABLE T7 import tablespace;
Query OK, 0 rows affected, 1 warning (0.26 sec)
6. Query the data, lucky back!
Mysql> SELECT * from T7;
+-----+------+
| I | name |
+-----+------+
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| 6 | 1 |
| 7 | 2 |
| 8 | 3 |
| 100 | 1 |
| 101 | 2 |
| 102 | 3 |
+-----+------+
9 Rows in Set (0.00 sec)
Mysql>
In-Memory database:
Mysql> CREATE TABLE T8 engine=memory select * from T7;
Mysql> Show Table status like ' T8 ' \g
Mysql> CREATE index Mem_hash using hash on T8 (i);
Query OK, 9 rows affected (0.03 sec)
Records:9 duplicates:0 warnings:0
Mysql> DROP index Mem_hash on T8;
Query OK, 9 rows affected (0.04 sec)
Records:9 duplicates:0 warnings:0
Mysql> CREATE index Mem_hash using Btree on T8 (i);
Query OK, 9 rows affected (0.03 sec)
Records:9 duplicates:0 warnings:0
Mysql> Show index from T8 \g
Attempt to reply to a single table with an IDB file