When an independent table space is used, if you accidentally damage the metadata file ibdata of the innodb Storage engine, we can save valuable data because innodb uses an independent table
When an independent table space is used, if you accidentally damage the metadata file ibdata of the innodb Storage engine, we can save valuable data because innodb uses an independent table
When an independent tablespace is used, if the metadata file ibdata of the innodb Storage engine is damaged accidentally, we can save valuable data. when innodb uses an independent tablespace, The ibdata file records the id of each innodb table, as long as the table id in ibd is the same as that recorded in the ibdata file, you can open the table and read the data.
# Creating a table
Create table 'ibdtest '(
'Id' int (11) not null AUTO_INCREMENT,
'Fid' int (11) not null comment' id' in Table B ',
'Content' char (255) not null comment' operation content, system generated ',
'Mark' char (255) not null comment' COMMENT ',
Primary key ('id ')
) ENGINE = InnoDB default charset = utf8
# Add data
INSERT ibdtest (fid, content, mark) VALUES (1, '1', '1'), (2, '2', '2 ');
SELECT * FROM ibdtest;
Disable mysql and copy ibdtest. ibd to other databases to simulate disasters.
[Root @ localhost ~] #/Opt/soft/mysql/bin/mysqladmin-p123456 shutdown
120130 18:31:50 mysqld_safe mysqld from pidfile/opt/soft/mysql/60137. localdomain. pid ended
[1] + Done/opt/soft/mysql/bin/mysqld_safe -- defaults-file =/opt/soft/mysql/config/my. cnf -- user = mysql
,