mysql 表存储位置更改

mysql> USE test;

Database changed

mysql> SHOW VARIABLES LIKE 'innodb_file_per_table';

+-----------------------+-------+

|Variable_name | Value |

+-----------------------+-------+

|innodb_file_per_table | ON |

+-----------------------+-------+

mysql> CREATE TABLE t1 (c1 INT PRIMARY KEY) DATA DIRECTORY = '/alternative/directory';

# MySQL creates a .ibd file for the new table in a subdirectory that corresponding# to the database name

db_user@ubuntu:~/alternative/directory/test$ ls t1.ibd

# MySQL creates a .isl file containing the path name for the table in a directory# beneath the MySQL data directory

db_user@ubuntu:~/mysql/data/test$ ls db.opt t1.frm t1.isl

posted @ 2018-07-18 10:40  爱热闹的杨小厨  阅读(1328)  评论(0编辑  收藏  举报