First, create a table test_0
CREATE TABLE ' te '. ' Test_0 ' (' ID ' INT (9) Zerofill not NULL, ' name ' VARCHAR (), PRIMARY KEY (' id ')) EN Gine=innodb;
Second, delete the following 3 files
Files directory : D:\Program files\mysql\mysql Server 5.5\data
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6C/DA/wKioL1VUXfXx2-XuAADXqGnHcQk947.jpg "title=" S.png " alt= "Wkiol1vuxfxx2-xuaadxqgnhcqk947.jpg"/>
Third, restart the database, and then The following issues occurred while accessing TEST_0
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6C/DB/wKioL1VUXzrCxw2PAAGALF1BoaA084.jpg "title=" T.png " alt= "Wkiol1vuxzrcxw2paagalf1boaa084.jpg"/>
At this time, the table can not be accessed, how, the table structure is not backed up, how can the table structure to restore it???
Iv. start preparing for the recovery table structure
-
Recreate a innodb table, such as:
create TABLE Test (' id ' BIGINT ()) ENGINE = INNODB;
-
Close the MySQL server to D:\Program files\mysql\mysql server 5.5\data\te, delete the test.frm, and change the test_0.frm name to Test.frm
-
Modify the My.ini file and add it under mysqld: innodb_force_recovery=6
-
Start MySQL Server.
-
To see the test table
650) this.width=650; "Src=" http://s3.51cto.com/wyfs02/M01/6C/DB/ Wkiol1vuynzztpqpaaeldtdrc6o016.jpg "title=" Q.png "alt=" wkiol1vuynzztpqpaaeldtdrc6o016.jpg "/>
-
OK, now that the table structure of the test_0 is restored, and then, the table structure of the test is exported, and the name of the Create is changed to Test_0, then the
-
Restored statement is as follows:
CREATE TABLE ' test_0 ' (' ID ' INT (9) UNSIGNED Zerofill not null, ' name ' VARCHAR () DEFAULT NULL, PRIMARY KE Y (' id ')) engine=innodb DEFAULT Charset=utf8
Note: If the table is less than the time, recovery can also, when the table more time, this method is more troublesome!!!
After MySQL deleted ibdata1, how to restore the table structure through the. frm file