Symlinks are fully supported only for MyISAM
tables.
對應Innodb引擎資料檔案放到其他目錄
mysql> SHOW VARIABLES LIKE 'innodb_file_per_table';
+-----------------------+-------+
| Variable_name | Value |
+-----------------------+-------+
| innodb_file_per_table | ON |
+-----------------------+-------+
mysql> CREATE TABLE y666 (c1 INT PRIMARY KEY) TABLESPACE = innodb_file_per_table
DATA DIRECTORY = '/usr/local/mysql/mydata';
建完再目錄下(庫名test下)
[root@centos_TP test]# dir
y666.ibd
如果在主從環境中建表,必須保證複製的其他資料庫路徑有,並且不能報錯,如:/usr/local/mysql/mydata
否則同步複製會報錯!