当前位置:Gxlcms > 数据库问题 > MySQL-5.7设置InnoDB表数据文件存储位置

MySQL-5.7设置InnoDB表数据文件存储位置

时间:2021-07-01 10:21:17 帮助过:33人阅读

[root@localhost data]# ls
a1  a2  a3  auto.cnf  ib_buffer_pool  ibdata1  ib_logfile0  ib_logfile1  ibtmp1  localhost.localdomain.err  localhost.localdomain.pid  mysql  performance_schema  sys

ibdata1就是InnoDB表的共享存储空间,默认innodb所有表的数据都在一个ibdata1里。

查看当前配置

mysql> show variables like ‘%per_table%‘;
+-----------------------+-------+
| Variable_name         | Value |
+-----------------------+-------+
| innodb_file_per_table | ON    |
+-----------------------+-------+
1 row in set (0.02 sec)

目前是打开状态,表示数据将按表单独存储。

若未开启,设置配置文件,加入如下行:

innodb_file_per_table=1

MySQL-5.7设置InnoDB表数据文件存储位置

标签:inno   表数   tab   root   tmp   mys   main   table   log   

人气教程排行