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