Preamble
MySQL Server supports the validate-config option, which allows checking the startup configuration for problems without starting the server in normal operation mode:
- If no errors are found, the server terminates with the output code 0.
- If an error is found, the server displays a diagnostic message and terminates with output code 1.
Valate-config can be used at any time, but is especially useful after an upgrade to check if any options previously used with an older server, an upgraded server are considered obsolete or outdated.
MySQL version and configuration
First let’s have some information about my MySQL version and configuration.
$ mysqld --help --verbose | head -n13
mysqld Ver 8.0.16 for Linux on x86_64 (MySQL Community Server - GPL)
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
affiliates. Other may be trademarks of their respective
owners.
Starts the MySQL database server.
Usage: mysqld [OPTIONS].
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf
We use MySQL server 8.0.16
The default configuration of the parameters is read in the specified order from:
/etc/my.cnf
/etc/mysql/my.cnf
/usr/local/mysql/etc/my.cnf
~ / .My.cnf
Now let’s check the start-up configuration of my MySQL server:
$ mysqld --validate-config
$
No error ! No output, everything looks good. Our server will start with this configuration. In case of an error the server will shut down.
The output is clearly different:
$ mysqld --validate-config --fake-option
2019-06-05T15:10:08.653775Z 0 [ERROR] [MY-000068] [Server] unknown option '--fake-option'.
2019-06-05T15:10:08.653822Z 0 [ERROR] [MY-010119] [Server] Aborting
Usually your configuration settings are written in your configuration file (usually with the name my.cnf).
So you can also use validate-config in this context:
$ mysqld --defaults-file=/etc/my.cnf --validate-config
$
Note:
- defaults-file, if specified, should be the first parameter on the command line.
- Alternatively, you can handle verbosity using log_error_verbosity:
- A value of 1 gives you an ERROR
- A value of 2 gives you ERROR and WARNING.
- A value of 3 gives you an ERROR, WARNING AND INFORMATION (i.e. a note).
With a value of 2, in addition to errors, we will be able to display warnings:
$ mysqld --defaults-file=/etc/my.cnf --validate-config --log_error_verbosity=2
2019-06-05T15:53:42.785422Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-days' is deprecated and will be removed in a future release. Please use binlog_expire_logs_seconds instead.
2019-06-05T15:53:42.785660Z 0 [Warning] [MY-0101] [Server] Insecure configuration for --secure-file-priv: Location is accessible to all OS users. Consider choosing a different directory.
Nothing particularly serious, but it is recommended to remove the warnings if possible.
Therefore, we have fixed these warnings:
Use binlog_expire_logs_seconds instead of expire-logs-days
Set the correct permissions for your secure-file-priv directory
$ mysqld --defaults-file=/etc/my.cnf --validate-config --log_error_verbosity=2
2019-06-05T16:04:32.363297Z 0 [ERROR] [MY-000067] [Server] unknown variable 'binlog_expire_logs_second=7200'.
2019-06-05T16:04:32.363369Z 0 [ERROR] [MY-010119] [Server] Aborting
Sorry !!! There is a misprint …: -0
We wrote binlog_expire_logs_second instead of binlog_expire_logs_seconds. (We forgot the last “s”). In this case my MySQL server cannot start.
Thanks to validate-config ! Now we can avoid unpleasant sensations when starting the server. If written correctly, we now have no errors or warnings:
$ mysqld --defaults-file=/etc/my.cnf --validate-config --log_error_verbosity=2
$
Note that you can also use value 3:
$ mysqld --defaults-file=/etc/my.cnf --validate-config --log_error_verbosity=3
2019-06-05T16:02:03.589770Z 0 [Note] [MY-010747] [Server] Plugin 'FEDERATED' is disabled.
2019-06-05T16:02:03.590719Z 0 [Note] [MY-010733] [Server] Shutting down plugin 'MyISAM'.
2019-06-05T16:02:03.590763Z 0 [Note] [MY-010733] [Server] Shutting down plugin 'CSV'
It is convenient and can be very useful. It may be worth including it in the update process.
Note:
- Defaults-file, if specified, should be the first parameter on the command line.
- Alternatively, you can handle verbosity using log_error_verbosity:
- A value of 1 gives you an ERROR
- A value of 2 gives you ERROR and WARNING.
- A value of 3 gives you an ERROR, WARNING AND INFORMATION (i.e. a note).
With a value of 2, in addition to errors, we will be able to display warnings:
$ mysqld --defaults-file=/etc/my.cnf --validate-config --log_error_verbosity=2
2019-06-05T15:53:42.785422Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-days' is deprecated and will be removed in a future release. Please use binlog_expire_logs_seconds instead.
2019-06-05T15:53:42.785660Z 0 [Warning] [MY-0101] [Server] Insecure configuration for --secure-file-priv: Location is accessible to all OS users. Consider choosing a different directory.
Nothing particularly serious, but it is recommended to remove the warnings if possible.
Therefore, we have fixed these warnings:
- Use binlog_expire_logs_seconds instead of expire-logs-days
- Set the correct permissions for your secure-file-priv directory
$ mysqld --defaults-file=/etc/my.cnf --validate-config --log_error_verbosity=2
2019-06-05T16:04:32.363297Z 0 [ERROR] [MY-000067] [Server] unknown variable 'binlog_expire_logs_second=7200'.
2019-06-05T16:04:32.363369Z 0 [ERROR] [MY-010119] [Server] Aborting
Sorry !!! There is a misprint …: -0
We wrote binlog_expire_logs_second instead of binlog_expire_logs_seconds. We forgot the last “s”. In this case my MySQL server cannot start. Thanks to validate-config! Now we can avoid unpleasant sensations when starting the server.
If written correctly, we now have no errors or warnings:
$ mysqld --defaults-file=/etc/my.cnf --validate-config --log_error_verbosity=2
$
Note that you can also use value 3:
$ mysqld --defaults-file=/etc/my.cnf --validate-config --log_error_verbosity=3
2019-06-05T16:02:03.589770Z 0 [Note] [MY-010747] [Server] Plugin 'FEDERATED' is disabled.
2019-06-05T16:02:03.590719Z 0 [Note] [MY-010733] [Server] Shutting down plugin 'MyISAM'.
2019-06-05T16:02:03.590763Z 0 [Note] [MY-010733] [Server] Shutting down plugin 'CSV'
It is convenient and can be very useful. It may be worth including it in the update process.
About Enteros
Enteros helps associations of each size with making their cloud data stockrooms work for any usage case and our experts are skilled in the fluctuating nuances of the different data circulation focus courses of action.
The views expressed on this blog are those of the author and do not necessarily reflect the opinions of Enteros Inc. This blog may contain links to the content of third-party sites. By providing such links, Enteros Inc. does not adopt, guarantee, approve, or endorse the information, views, or products available on such sites.
Are you interested in writing for Enteros’ Blog? Please send us a pitch!
RELATED POSTS
Open Banking APIs: Where Performance = Trust
- 30 October 2025
- Software Engineering
Introduction Open banking promised to be a paradigm shift — enabling consumers to share financial data securely and allowing banks, fintechs, and third parties to build innovative services on that foundation. But as the ecosystem evolves, one truth stands out: it’s not just about access — it’s about performance. An open banking API that’s slow, … Continue reading “Open Banking APIs: Where Performance = Trust”
Enteros for the Travel Industry: Enhancing Cost Estimation Accuracy Through AIOps, Observability, and Cloud FinOps
Introduction In the fast-moving world of travel and hospitality, accurate cost estimation isn’t just a finance issue—it’s a performance challenge. From dynamic booking systems and real-time analytics to backend inventory databases and AI-driven recommendation engines, every operational layer relies on complex data interactions. The travel industry has always faced volatile demand, fluctuating operating costs, and … Continue reading “Enteros for the Travel Industry: Enhancing Cost Estimation Accuracy Through AIOps, Observability, and Cloud FinOps”
Transforming Data Lake Efficiency in the Technology Sector: How Enteros’ AI Performance Platform Redefines Database Optimization
Introduction In today’s data-driven technology landscape, the backbone of innovation lies in how efficiently enterprises manage and utilize their data. With the rise of big data, cloud ecosystems, and AI workloads, data lakes have become the central hub of data intelligence—storing massive volumes of structured, semi-structured, and unstructured data. However, as organizations scale their digital … Continue reading “Transforming Data Lake Efficiency in the Technology Sector: How Enteros’ AI Performance Platform Redefines Database Optimization”
Redefining Healthcare Efficiency: AI-Driven Backlog Prioritization and Capital Expenditure Optimization with Enteros
- 29 October 2025
- Database Performance Management
Introduction The healthcare industry is under constant pressure to balance two competing priorities — improving patient outcomes and managing operational efficiency within constrained budgets. With digital transformation accelerating across hospitals, clinics, and research institutions, vast amounts of data are being generated from electronic health records (EHRs), diagnostic imaging, clinical workflows, and administrative systems. This influx … Continue reading “Redefining Healthcare Efficiency: AI-Driven Backlog Prioritization and Capital Expenditure Optimization with Enteros”