Error
Error Code:
67
MySQL Error 67: Unknown Configuration Variable
Description
Error 67, 'unknown variable', indicates that MySQL encountered a system variable or configuration option that it does not recognize. This typically happens when the MySQL server is starting up and processing its configuration file (e.g., `my.cnf` or `my.ini`), or when a user attempts to set a non-existent variable.
Error Message
unknown variable '%s'.
Known Causes
4 known causesTypo or Misspelling
A system variable name in the configuration file or a `SET` statement contains a typo or is misspelled, causing MySQL to not recognize it.
Deprecated or Removed Variable
The specified variable was valid in a previous MySQL version but has been deprecated, renamed, or removed in the current version being used.
Incorrect Scope or Syntax
Attempting to set a variable with an incorrect `GLOBAL` or `SESSION` keyword, or using syntax that is not valid for the variable type or context.
Variant-Specific Variable
The variable is specific to a different MySQL variant (e.g., MariaDB, Percona Server) and is not recognized by the standard MySQL server.
Solutions
4 solutions available1. Verify Configuration Variable Name easy
Double-check the spelling and case of the configuration variable you are trying to set or access.
1
Carefully review the configuration file (e.g., `my.cnf`, `my.ini`) or the command you are using to set the variable. Ensure that the variable name is spelled correctly and matches the expected case. MySQL configuration variables are case-insensitive, but it's good practice to match documentation or existing settings.
Example of a correct setting in `my.cnf`:
ini
[mysqld]
innodb_buffer_pool_size = 128M
Example of a command-line setting:
bash
mysql --variable-name=value
2
If you are using a tool or application to connect to MySQL and it's reporting this error, check its specific configuration settings for any variables it's trying to use. Consult the documentation for that tool.
Consult the documentation for your specific MySQL client or application.
2. Check MySQL Version Compatibility medium
Ensure the configuration variable exists and is supported in your specific MySQL version.
1
Identify the exact version of your MySQL server. You can do this by connecting to the server and running the following SQL command:
SELECT VERSION();
2
Consult the official MySQL documentation for your specific version. Search for the configuration variable in question to confirm its existence and syntax. For example, if you are using MySQL 5.7, search for 'MySQL 5.7 server system variables'.
Visit the official MySQL documentation website (dev.mysql.com/doc/) and select your MySQL version.
3
If the variable is new or deprecated in your version, you may need to update your configuration file or adjust your application's behavior accordingly. For instance, a variable might have been renamed or removed in a newer version.
Example: If `old_variable` was removed in MySQL 8.0, you might need to use `new_variable` instead.
3. Locate and Correct the Configuration File medium
Find the active MySQL configuration file and fix any incorrect variable assignments.
1
Determine which configuration file MySQL is currently using. Connect to your MySQL server and run the following command:
SHOW VARIABLES LIKE '!@@basedir';
SHOW VARIABLES LIKE '@@datadir';
2
Based on the output of the previous command and your operating system, locate the primary configuration file. Common locations include:
- Linux: `/etc/my.cnf`, `/etc/mysql/my.cnf`, `/etc/mysql/mysql.conf.d/mysqld.cnf`
- Windows: `C:\ProgramData\MySQL\MySQL Server X.Y\my.ini` (where X.Y is your version)
- Linux: `/etc/my.cnf`, `/etc/mysql/my.cnf`, `/etc/mysql/mysql.conf.d/mysqld.cnf`
- Windows: `C:\ProgramData\MySQL\MySQL Server X.Y\my.ini` (where X.Y is your version)
Example on Linux:
bash
cat /etc/mysql/my.cnf
3
Open the identified configuration file in a text editor. Look for lines that define the variable causing the error. Correct any typos or incorrect syntax.
Example of a corrected line:
ini
# Incorrect:
# some_varible = 10M
# Correct:
innodb_buffer_pool_size = 10M
4
After making changes, restart the MySQL server for the new configuration to take effect.
On systemd-based systems (e.g., Ubuntu 15.04+, CentOS 7+):
bash
sudo systemctl restart mysql
On older init.d systems:
bash
sudo /etc/init.d/mysql restart
On Windows:
Open Services (services.msc), find the MySQL service, and restart it.
4. Review Dynamic System Variable Usage medium
Check if you are trying to set a dynamic variable at startup or a non-dynamic variable at runtime.
1
Understand the difference between static and dynamic system variables. Static variables can only be set in the configuration file at server startup. Dynamic variables can be set in the configuration file or changed at runtime using `SET GLOBAL` or `SET SESSION`.
Refer to the MySQL documentation for a list of system variables and their characteristics (static/dynamic).
2
If you are encountering this error when trying to set a variable via `SET GLOBAL` or `SET SESSION`, and the variable is static, you must move the setting to your configuration file (`my.cnf`/`my.ini`) and restart the MySQL server.
Example: `read_only` is a dynamic variable, but `innodb_flush_log_at_trx_commit` is also dynamic. However, some variables might be static in older versions and dynamic in newer ones. Always check documentation.
If `some_static_variable` is static, this will fail:
sql
SET GLOBAL some_static_variable = 1;
Instead, modify `my.cnf`:
ini
[mysqld]
some_static_variable = 1
and restart MySQL.
3
Conversely, if you are trying to set a variable in the configuration file that is intended to be set dynamically (and is not a valid startup parameter), you might encounter issues. Ensure you are using the correct method for each variable.
Example: Trying to set a session-specific variable in `my.cnf` might not behave as expected if it's not a global server setting.