Skip to content

Instantly share code, notes, and snippets.

@hustjiangtao
Last active June 25, 2019 02:53
Show Gist options
  • Save hustjiangtao/ba299a4b93a2c40a02f298fb6de92dc0 to your computer and use it in GitHub Desktop.
Save hustjiangtao/ba299a4b93a2c40a02f298fb6de92dc0 to your computer and use it in GitHub Desktop.
mysql conifg for mysql5.7 innodb
  • mysql在小内存服务器上的优化设置

直接安装的mysql5.7默认使用innodb引擎,默认开启performance_schema,故针对innodb优化,并关闭performance_schema,即可大幅优化内存占用 其中performance_schema影响最大,在不需要的前提下,可直接设置 performance_schema=0 即可。

# vim /etc/my.cnf
[mysqld]
performance_schema=0
innodb_buffer_pool_size = 64M
innodb_log_file_size = 18M
innodb_flush_log_at_trx_commit = 0
innodb_flush_method = O_DIRECT
performance_schema_max_table_instances=200
table_definition_cache=200
table_open_cache=128
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment