content_image/685763.jpg content_image/685764.jpg content_image/685765.jpg
• TABLESPACE 

The TABLESPACE  clause can be used to create a table in an existing general tablespace, a file-per-table tablespace, or the system tablespace. 

CREATE TABLE tbl_name  ... TABLESPACE [=] tablespace_name 

The general tablespace that you specify must exist prior to using the TABLESPACE  clause. For information about general tablespaces, see Section 15.6.3.3, “General Tablespaces” . 

The tablespace_name  is a case-sensitive identifier. It may be quoted or unquoted. The forward slash character (“/” ) is not permitted. Names beginning with “innodb_”  are reserved for special use. 

To create a table in the system tablespace, specify innodb_system  as the tablespace name. 

CREATE TABLE tbl_name  ... TABLESPACE [=] innodb_system 

Using TABLESPACE [=] innodb_system , you can place a table of any uncompressed row format in the system tablespace regardless of the innodb_file_per_table  setting. For example, you can add a table with ROW_FORMAT=DYNAMIC  to the system tablespace using TABLESPACE [=] innodb_system . 

To create a table in a file-per-table tablespace, specify innodb_file_per_table  as the tablespace name. 

CREATE TABLE tbl_name  ... TABLESPACE [=] innodb_file_per_table 

<img src='content_image/685763.jpg'>

## Note 

If innodb_file_per_table  is enabled, you need not specify TABLESPACE=innodb_file_per_table  to create an InnoDB  file-per-table tablespace. InnoDB  tables are created in file-per-table tablespaces by default when innodb_file_per_table  is enabled. 

The DATA DIRECTORY  clause is permitted with CREATE TABLE ... TABLESPACE=innodb_file_per_table  but is otherwise not supported for use in combination with the TABLESPACE  clause. As of MySQL 8.0.21, the directory specified in a DATA DIRECTORY  clause must be known to InnoDB . For more information, see Using the DATA DIRECTORY Clause. 

<img src='content_image/685764.jpg'>

## Note 

Support for TABLESPACE = innodb_file_per_table  and TABLESPACE = innodb_temporary  clauses with CREATE TEMPORARY TABLE  is deprecated as of MySQL 8.0.13; expect it to be removed in a future version of MySQL. 

The STORAGE  table option is employed only with NDB  tables. STORAGE  determines the type of storage used (disk or memory), and can be either DISK  or MEMORY . 

TABLESPACE ... STORAGE DISK  assigns a table to an NDB Cluster Disk Data tablespace. The tablespace must already have been created using CREATE TABLESPACE . See Section 23.5.10, “NDB Cluster Disk Data Tables” , for more information. 

<img src='content_image/685765.jpg'>

## Important 

A STORAGE  clause cannot be used in a CREATE TABLE  statement without a TABLESPACE  clause. 

