5

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?

dkp
  • 81
  • 1
  • 1
  • 4
  • 1
    Please explain why you want to do it. Be aware that almost no one has changed the page size; so if you do so, we will only be guessing if you need any help. – Rick James May 17 '19 at 05:37

1 Answers1

8

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
Bill Karwin
  • 538,548
  • 86
  • 673
  • 828