Innodb页面大小设置 [英] Innodb page size setting

查看:546
本文介绍了Innodb页面大小设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在innodb中,页面大小称为默认16kb. 如何将页面大小设置为8kb? 在源代码编译步骤中可以设置一个选项吗?

In innodb, the page size is known as default 16kb. How do I set the page size to 8kb? Is there an option to set in the source compilation step?

推荐答案

您无需在源编译步骤中指定页面大小. MySQL 5.6和更高版本支持不同的页面大小,而无需重新编译.

You don't need to specify page size in the source compilation step. MySQL 5.6 and later support different page sizes without recompiling.

但是,必须在初始化InnoDB表空间之前设置页面大小.所有表空间(包括每表表空间,常规表空间,撤消表空间,临时表空间等)必须使用相同的页面大小.

You must, however, set the page size before the InnoDB tablespace is initialized. All tablespaces (including per-table tablespaces, general tablespaces, undo tablespaces, temp tablespaces, etc.) must use the same page size.

通过将以下行放在/etc/my.cnf文件的[mysqld]部分中,将页面大小设置为8KB:

You set the page size to 8KB by putting this line in your /etc/my.cnf file, in the [mysqld] section:

innodb_page_size=8K

您需要在初始化InnoDB表空间之前执行此操作.如果要稍后更改页面大小:

You need to do this before the InnoDB tablespaces are initialized. If you want to change the page size later:

  1. 转储所有数据
  2. 停止mysqld
  3. 更改我在上面显示的配置选项
  4. 启动mysqld,它将以新的页面大小自动初始化一个新的InnoDB表空间
  5. 重新导入数据

这篇关于Innodb页面大小设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆