•As of MySQL 8.0.21, tables created in file-per-table tablespaces can no longer be created in the undo tablespace directory ( innodb_undo_directory ) unless that directly is known to InnoDB . Known directories are those defined by the datadir , innodb_data_home_dir , and innodb_directories variables. 

## Using CREATE TABLE ... TABLESPACE Syntax 

CREATE TABLE ... TABLESPACE  syntax can be used in combination with the DATA DIRECTORY  clause to create a table in an external directory. To do so, specify innodb_file_per_table  as the tablespace name. 

mysql> CREATE TABLE t2 (c1 INT PRIMARY KEY) TABLESPACE = innodb_file_per_table DATA DIRECTORY = ’/external/directory’; 

This method is supported only for tables created in file-per-table tablespaces, but does not require the innodb_file_per_table  variable to be enabled. In all other respects, this method is equivalent to the CREATE TABLE ... DATA DIRECTORY  method described above. The same usage notes apply. 

## Creating a Table in an External General Tablespace 

You can create a table in a general tablespace that resides in an external directory. 

•For information about creating a general tablespace in an external directory, see Creating a General Tablespace. 

•For information about creating a table in a general tablespace, see Adding Tables to a General Tablespace. 

## 15.6.1.3 Importing InnoDB Tables 

This section describes how to import tables using the Transportable Tablespaces  feature, which permits importing tables, partitioned tables, or individual table partitions that reside in file-per-table tablespaces. There are many reasons why you might want to import tables: 

•To run reports on a non-production MySQL server instance to avoid placing extra load on a production server. 

•To copy data to a new replica server. 

•To restore a table from a backed-up tablespace file. 

•As a faster way of moving data than importing a dump file, which requires reinserting data and rebuilding indexes. 

•To move a data to a server with storage media that is better suited to your storage requirements. For example, you might move busy tables to an SSD device, or move large tables to a high-capacity HDD device. 

The Transportable Tablespaces  feature is described under the following topics in this section: 

•Prerequisites 

•Importing Tables 

•Importing Partitioned Tables 

•Importing Table Partitions 

•Limitations 

•Usage Notes 

