Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Innodb page size setting

Tags:

mysql

innodb

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?

like image 734
dkp Avatar asked Mar 05 '23 02:03

dkp


1 Answers

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

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.

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

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

  1. Dump all your data
  2. Stop mysqld
  3. Change the configuration option I showed above
  4. Start mysqld, which will initialize a new InnoDB tablespace automatically, with the new page size
  5. Re-import your data
like image 170
Bill Karwin Avatar answered Mar 20 '23 14:03

Bill Karwin