Error
Error Code:
1193
MariaDB Error 1193: Unknown System Variable
Description
MariaDB Error 1193, "Unknown system variable '%s'", indicates that the database server has encountered a system variable name that it does not recognize. This typically occurs when a SQL query, configuration file, or application attempts to reference a variable that is either misspelled, does not exist in the current MariaDB version, or is specific to a different database fork.
Error Message
Unknown system variable '%s'
Known Causes
3 known causesTypo or Misspelling
A simple typographical error in the system variable name prevents MariaDB from identifying it correctly.
Variable Does Not Exist
The referenced system variable is not a valid or defined variable within the current MariaDB server instance or version.
Version Incompatibility
The variable might exist in a different MariaDB or MySQL version but is not supported in the specific MariaDB version being used.
Solutions
3 solutions available1. Verify System Variable Name and Version Compatibility easy
Check for typos and ensure the variable exists in your MariaDB version.
1
Carefully review the system variable name mentioned in the error message. Typos are a common cause.
2
Consult the MariaDB documentation for your specific version to confirm the existence and correct spelling of the system variable.
SELECT @@<variable_name>; -- Replace <variable_name> with the actual variable from the error
-- For example, if the error is 'Unknown system variable 'max_connections_per_user'', try:
SELECT @@max_connections_per_user;
3
If you are trying to set a variable that was introduced in a newer version of MariaDB, you may need to upgrade your server.
2. Check `my.cnf` or Configuration Files for Typos medium
Incorrectly spelled system variables in configuration files can lead to this error.
1
Locate your MariaDB configuration file(s). Common locations include `/etc/my.cnf`, `/etc/mysql/my.cnf`, `/etc/mysql/mariadb.conf.d/`, or within the MariaDB data directory.
2
Open the configuration file(s) in a text editor.
3
Search for the system variable name that caused the error. Look for any misspellings or incorrect syntax when it's being set.
# Example of a potential typo in my.cnf:
[mysqld]
max_connection = 200 # Should likely be max_connections
4
Correct any typos or syntax errors. Ensure the variable name is spelled correctly and follows the standard `variable_name = value` format.
5
Save the changes to the configuration file(s).
6
Restart the MariaDB service for the changes to take effect.
sudo systemctl restart mariadb
3. Inspect Client Connection Parameters easy
Ensure system variables are not being set incorrectly during client connections.
1
If the error occurs during a client connection (e.g., from a script, application, or command-line client), examine the connection string or command-line arguments.
2
Look for any attempts to set system variables using `SET GLOBAL` or `SET SESSION` commands within the connection parameters or initialization scripts.
# Example in a connection string or script:
--connect-options="--sql-mode='STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' --init-file=/path/to/init.sql"
# Or within an init.sql file:
SET SESSION unknown_variable = 'some_value';
3
Verify that all variable names used in these commands are valid and correctly spelled for your MariaDB version.
4
Remove or correct any invalid system variable assignments.