MySQL cannot start because my.cnf contains an invalid or misplaced !include or !includedir directive.
MySQL Error 49: EE_WRONG_DIRECTIVE_IN_CONFIG_FILE means the server found an invalid !include or !includedir directive in my.cnf. Remove or correct the directive path, place it in the proper section, then restart MySQL to fix the issue.
Wrong '!%s' directive in config file %s at line %d. EE_WRONG_DIRECTIVE_IN_CONFIG_FILE was added in 8.0.13.
MySQL raises this global error when it parses a configuration file and encounters an unsupported, misspelled, or context-invalid directive beginning with an exclamation mark. The server stops reading the file and aborts startup.
The message shows the bad directive, the file path, and the exact line number, helping administrators locate the misconfiguration quickly.
The server will not start or will ignore the entire configuration block, leading to default settings, security gaps, or downtime.
Fixing the directive is essential for normal operation and predictable behavior.
Misplaced !include or !includedir directives inside option groups other than [mysqld] trigger the error because the parser allows them only at the global scope.
Typos such as !incldue or unsupported directives like !sys_var create the same failure because MySQL cannot interpret them.
Using relative paths that resolve outside allowed directories or pointing to non-existent files also causes MySQL to reject the directive.
Open the file named in the message, navigate to the reported line, and verify the directive spelling.
Ensure you use exactly !include or !includedir.
Move the directive outside any section headers or place it at the top of the file before the first [group].
Provide an absolute path to a readable file or directory. Confirm permissions allow the mysql user to read the included files.
Docker containers often mount custom my.cnf files that reference host-only paths.
Use container-internal paths or copy the file into the image to eliminate the error.
Automated configuration tools may append !includedir directives inside template blocks.
Adjust the template to insert directives at the top level.
Keep one primary my.cnf and place all !include statements at the very beginning to guarantee correct parsing order.
Validate configuration changes with mysqld --verbose --help --no-defaults --defaults-file=/path/to/my.cnf 2>&1 | less before restarting production servers.
Version-control configuration files and use CI checks that run mysqld --initialize-insecure to catch directive errors early.
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option - arises when file paths fall outside secure_file_priv.
mysqld: unknown option '--something' - appears when an option is placed in the wrong group or is deprecated.
.
Relative paths work but are risky. Always prefer absolute paths to avoid resolution errors, especially inside Docker or systemd services.
Yes. Directives must precede any option groups or MySQL ignores them and raises error 49.
The server stops parsing the file and aborts startup, so none of the remaining options are applied.
Galaxy surfaces MySQL startup logs inside its integrated terminal, highlighting configuration errors instantly so developers can correct them before deploying changes.