Creating file-per-table tablespaces outside the data directory

一、 Data Directory

1、应对情况

当数据库所在空间不足的时候,通过新增一块磁盘,如何将新建的表放到新建磁盘,就可以用到MySQL的Data Directory

2、使用Data Directory条件

1)InnoDB引擎

2)开启innodb_file_per_table或者在建表时加上此参数

二、操作测试

1、查看数据库版本与表空间目录

MySQL Data Directory -- Creating file-per-table tablespaces outside the data directory

2、操作系统新建存储目录

MySQL Data Directory -- Creating file-per-table tablespaces outside the data directory

3、建表测试

MySQL Data Directory -- Creating file-per-table tablespaces outside the data directory

4、查看新建的表

1)表的定义文件任然保存在老的数据文件目录

MySQL Data Directory -- Creating file-per-table tablespaces outside the data directory

2)表的tablespace在新的数据文件目录

MySQL Data Directory -- Creating file-per-table tablespaces outside the data directory

 

相关文章:

  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2021-05-14
  • 2021-12-23
  • 2021-07-13
  • 2021-06-16
猜你喜欢
  • 2021-06-23
  • 2022-01-18
  • 2021-07-11
  • 2022-12-23
  • 2021-09-14
  • 2021-07-04
相关资源
相似解决方案