每个数据库目录中的db.opt是数据库的信息,表名.frm是表的元信息,表名.ibd是数据信息,其中innodb_file_per_table参数来控制是否单独存储,5.7默认on,之前版本默认off
mysql> show variables like '%per_table%'; +-----------------------+-------+ | Variable_name | Value | +-----------------------+-------+ | innodb_file_per_table | ON | +-----------------------+-------+ 1 row in set (0.01 sec) mysql>
myd .myi是老的MyISAM存储引擎,myi是索引信息
mysql> create table tmp2(id int); Query OK, 0 rows affected (0.02 sec) mysql> show create table tmp; +-------+-----------------------------------------------------------------------------------------+ | Table | Create Table | +-------+-----------------------------------------------------------------------------------------+ | tmp | CREATE TABLE `tmp` ( `id` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 | +-------+-----------------------------------------------------------------------------------------+ 1 row in set (0.00 sec) mysql>
Linux公社的RSS地址:https://www.linuxidc.com/rssFeed.aspx