Von Matthias Jung auf Donnerstag, 24. November 2022
Kategorie: MySQL (PDO)

Pleasing DBAs with small things: Validation of MySQL configuration

Configuration files are a constant source of errors. Especially with older systems (before version 8.0), which did not yet have the possibility to make online persistent changes (e.g. "set global persist…"), there were often minor problems. The parameter was set online (but volatile; i.e. not rebootable) due to a lack of downtime and was written to the configuration in parallel. If one mistyped here, one could go troubleshooting at the next planned or unplanned (!) restart of the DB. 

Configuration gibberish 

The spelling of name fidelity of parameters in the configuration file(s) (e.g. /etc/my.cnf or similar) is not very high. Is the parameter declared as "log_bin", "log-bin" or "logbin"? Surely some MySQL DBAs face such and/or similar questions quite often in practice. If you can restart the server, you can "iteratively" ( ;-) ) find the correct notation. But in the scenario described above (downtime unwanted) this is not possible. 

Just a little thing? 

Starting with version 8.0.16 there is now the possibility to check the configuration. For this, the option “--validate-config” was introduced. Here is a small example: 

Experienced MySQLers will know. The parameter is called "slow_query_log", of course. The error is reliably detected and should be corrected as soon as possible. 

Just a small thing! 

Yes, the new "--validate-config" parameter of the MySQL service is not a "big deal". Other applications (e.g. the Apache web server) know such options and / or commands to check the configuration status for a long time. Still, it's nice to see that even such small, unobtrusive improvements make it into the new MySQL releases.

Do you have questions about MySQL? Please contact us. 

Kommentare hinterlassen