怎么理解MySQL中innodb_file_per_table参数

网友投稿 344 2023-12-25

怎么理解MySQL中innodb_file_per_table参数

这篇文章将为大家详细讲解有关怎么理解MySQL中innodb_file_per_table参数,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。

怎么理解MySQL中innodb_file_per_table参数

在MySQL中创建表时,如果innodb_file_per_table为ON,则会生成两个文件tablename.frm和tablename.ibd。

如果innodb_file_per_table为OFF时,则只会生成一个文件tablename.frm,此表的数据将存放在ibdata*这个文件中。

mysql> show variables like %per_table%;

+---------------------------+-------+

| Variable_name           | Value|

+---------------------------+-------+

| innodb_file_per_table | ON    |

+---------------------------+-------+

mysql> use vast

mysql> create table testtbs(a int,b int);

mysql> insert into testtbs select 1,2;

mysql> insert into testtbs select 3,4;

[root@vast vast]# pwd

/data/mydb/vast

[root@vast vast]# ls *testtbs*

testtbs.frm  testtbs.ibd

mysql> show variables like %per_table%;

+---------------------------+-------+

| Variable_name           | Value|

+---------------------------+-------+

| innodb_file_per_table | OFF  |

+---------------------------+-------+

mysql> create table testtbs1(a int,b int);

mysql> insert into testtbs1 select 1,2;

mysql> insert into testtbs1 select 3,4;

[root@vast vast]# pwd

/data/mydb/vast

[root@vast vast]# ls *testtbs1*

testtbs1.frm

关于怎么理解MySQL中innodb_file_per_table参数就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:如何理解MySQL Profile在MySQL5.7的简单测试
下一篇:如何进行mysql5.7.15 主从复制环境搭建
相关文章

 发表评论

暂时没有评论,来抢沙发吧~