mysql 表空间指定位置

方式一:

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模式

猜你喜欢

转载自www.cnblogs.com/hanglinux/p/12507824.html