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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM