Innodb独立表空间的配置
来源:互联网 发布:自动整点报时软件 编辑:程序博客网 时间:2024/04/30 10:41
Innodb独立表空间的配置
环境介绍:
MySQL版本:5.5.40
1.查看独立表空间是否开启
mysql> show variables like '%per_table%';
+-----------------------+-------+
| Variable_name | Value |
+-----------------------+-------+
| innodb_file_per_table | OFF |
+-----------------------+-------+
1 row in set (0.00 sec)
说明:OFF代表mysql是共享表空间
2.停止mysql服务器:
[mysqld]
[root@localhost ~]#/etc/init.d/mysqld start
5.验证功能是否开启
mysql> show variables like '%per_table%';
+-----------------------+-------+
| Variable_name | Value |
+-----------------------+-------+
| innodb_file_per_table | ON |
+-----------------------+-------+
a.使用mysqldump备份数据
b.使用mysql恢复对应数据
参考链接:http://blog.csdn.net/jacson_bai/article/details/44781033
环境介绍:
MySQL版本:5.5.40
1.查看独立表空间是否开启
mysql> show variables like '%per_table%';
+-----------------------+-------+
| Variable_name | Value |
+-----------------------+-------+
| innodb_file_per_table | OFF |
+-----------------------+-------+
1 row in set (0.00 sec)
说明:OFF代表mysql是共享表空间
2.停止mysql服务器:
[root@localhost ~]#/etc/init.d/mysqld stop
3.修改my.cnf文件:[mysqld]
innodb-file-per-table=1
4.启动mysql[root@localhost ~]#/etc/init.d/mysqld start
5.验证功能是否开启
mysql> show variables like '%per_table%';
+-----------------------+-------+
| Variable_name | Value |
+-----------------------+-------+
| innodb_file_per_table | ON |
+-----------------------+-------+
1 row in set (0.00 sec)
如何迁移至独立表空间?
1.如果线上服务器需要保存数据的,还要多加2步a.使用mysqldump备份数据
b.使用mysql恢复对应数据
参考链接:http://blog.csdn.net/jacson_bai/article/details/44781033
2.删除旧文件时,既要删除ibdata*,也要删除相应log文件ib_logfile*,否则启动MySQL时,会提示异常缺少mysql.pid文件;
参考链接:http://dev.mysql.com/doc/refman/5.5/en/innodb-parameters.html#sysvar_innodb_file_per_table
独立表空间学习总结
优点:
1.数据库中每个表都有自已独立的表空间,每个表的数据和索引都会存在自已的表空间中。
2.可以实现单表在不同的数据库中移动。
3.快速回收表空间
回收表空间方法参考链接:http://blog.csdn.net/jacson_bai/article/details/45112465
缺点;
1.增加系统open_files数;
2.单个表的数据库文件容量较大,引起存储不好规划等。
注意点:
1.在启用innodb_file_per_table=1后必须合理调整下innodb_open_files大小,此参数值,最小为10,默认为300,是全局参数,不能动态调整;
2.根据自己的业务合理调整是否采用独立表空间
1 0
- MySQL Innodb独立表空间的配置
- Innodb独立表空间的配置
- InnoDB 引擎独立表空间 innodb_file_per_table
- InnoDB 引擎独立表空间 innodb_file_per_table
- InnoDB 引擎独立表空间 innodb_file_per_table
- InnoDB 引擎独立表空间 innodb_file_per_table
- InnoDB 引擎独立表空间 innodb_file_per_table
- InnoDB 引擎独立表空间 innodb_file_per_table
- InnoDB 引擎独立表空间 innodb_file_per_table
- InnoDB 引擎独立表空间 innodb_file_per_table
- InnoDB 引擎独立表空间 innodb_file_per_table
- InnoDB 引擎独立表空间 innodb_file_per_table
- mysql之innodb引擎的共享表空间和独立表空间
- Innodb共享表空间和独立表空间
- Innodb共享表空间VS独立表空间
- [Mysql]Innodb 独立表空间和共享表空间
- MySQL InnoDB 共享表空间和独立表空间
- MySQL InnoDB 共享表空间和独立表空间
- android l 编码 GBK 的不可映射字符
- 内核中 设备树的文档
- Matlab与C++混合编程(依赖OpenCV)
- Android Studio 之基本使用和常见问题
- Linux入门:Linux历史介绍
- Innodb独立表空间的配置
- 2015年学习计划 -- 努力成为合格程序员
- SSH架构搭建与项目实战
- Java中长度为0的数组与null的区别
- js给指定id的div下面创建元素
- SDN控制器之POX篇
- infinidb 更改数据存储路径
- Cygwin配置教程(一)
- Type mismatch: cannot convert from CharFragment to Fragment错误