Get the App
SLTechnology News&Howtos  ›  Database  › 

How to understand the innodb_file_per_table parameters in MySQL

Shulou Source: shulou.com Published: 2022-05-31 14:05:34 09月26日 Update

This article will explain in detail how to understand the innodb_file_per_table parameter in MySQL. The content of the article is of high quality, so Xiaobian shares it with you for reference. I hope you have a certain understanding of relevant knowledge after reading this article.

When creating a table in MySQL, if innodb_file_per_table is ON, two files tablename.frm and tablename.ibd are generated.

If innodb_file_per_table is OFF, only one file tablename.frm will be generated, and the data of this table will be stored in the file 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

About how to understand MySQL innodb_file_per_table parameter to share here, I hope the above content can be of some help to everyone, you can learn more knowledge. If you think the article is good, you can share it so that more people can see it.

Tags: Files parameters content articles more knowledge articles generation yes two data quality creation reference help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Shulou Tech Info Huawei Redmi MySQL