方式一:
root@localhost [mytest]>create table ts30(id int) DATA DIRECTORY='/test/'; Query OK, 0 rows affected (0.18 sec)
這種方式僅僅是創建了一個單表單表空間
方式二:
root@localhost [mytest]>create tablespace ts01 add datafile '/test/ts01.ibd'; Query OK, 0 rows affected (0.10 sec) root@localhost [mytest]>create table ts10(id int) tablespace=ts01; Query OK, 0 rows affected (0.10 sec) root@localhost [mytest]>alter table ts10 ADD INDEX ts10(id); Query OK, 0 rows affected (0.16 sec) Records: 0 Duplicates: 0 Warnings: 0
這種方式可以多個表使用一個表空間,表空間的類型是General模式