A data file that can hold data for one or more InnoDB tables and associated indexes.
There are many types of tablespaces based on the configuration w.r.t the information clubbing per table. These are,
a. System tablespace
b. File per tablespace
c. General tablespace
System tablespace contains,
- InnoDB data dictionary.
- DoubleWrite Buffer.
- Change buffer
- Undo Logs.
Apart from this it also contains,
- Tables &
- Index data
Associated file is .idbdata1
The innodb_file_per_table option, which is enabled by default in MySQL 5.6 and higher, allows tables to be created in file-per-table tablespaces, with a separate data file for each table. Enabling the innodb_file_per_table option makes available other MySQL features such as table compression and transportable tablespaces.
Associated file is .idbd
InnoDB introduced general tablespaces in MySQL 5.7.6. General tablespaces are shared tablespaces created using CREATE TABLESPACE syntax. They can be created outside of the MySQL data directory, are capable of holding multiple tables, and support tables of all row formats.