MySQL 8 sample config (my.cnf example) and tuning

Originally published at: MySQL 8 sample config (my.cnf example) and tuning.

With the release of MySQL 8 I wanted to paste my tuned my.cnf (MySQL configuration file) for discussion, suggestions, and questions. To get the most out of your MySQL 8 installation, you will need to configure it correctly and tune the settings for your specific use case. In this blog post, we will discuss my…

First recommendation is not to depend on innodb_dedicated_server = 1.

When innodb_dedicated_server is enabled, InnoDB automatically configures the following variables:

(innodb_log_file_size and innodb_log_files_in_group are deprecated in MySQL 8.0.30. These variables are superseded by the innodb_redo_log_capacity variable.)

Only enable innodb_dedicated_server if the MySQL instance resides on a dedicated server where it can use all available system resources. For example, consider enabling innodb_dedicated_server if you run MySQL Server in a Docker container or dedicated VM that only runs MySQL.

That said, you won’t gain any performance by using innodb_dedicated_server if you instead just set the MySQL variables optimally. So, this setting is more of a convenience, as it will simply automatically configure the variables to ~ what you should be using anyway.

Add your tips below.

Suggestion for MySQL 8 enable slow query log and fix those queries. Also choose InnoDB Over MyISAM as MyISAM is old news.