#1193 - Unknown system variable 'lc_messages' when trying to login to phpmyadmin

#1193 - Unknown system variable 'lc_messages' when trying to login to phpmyadmin

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

Resolving the Unknown system variable 'lc_messages' Error in phpMyAdmin

If you are staring at a #1193 - Unknown system variable 'lc_messages' error while attempting to log into phpMyAdmin, the root cause lies in a mismatch between your MySQL/MariaDB configuration and the client's expectations. This specific issue usually manifests immediately after installing MySQL on certain distributions or when upgrading from an older version where lc_messages was a global system variable.

The error originates from the SQL command SET lc_messages = 'en_US';. Historically, this variable controlled the language used for messages returned by the server to clients. However, in modern versions of MariaDB and newer MySQL releases (specifically 10.5+), this behavior has changed significantly. The server no longer supports lc_messages as a global or session system variable. Instead, message localization is handled entirely through the lc_messages column within the sql_mode context or, more commonly now, by relying on the client library's own locale settings without requiring an explicit server-side directive that sets this specific variable name.

When you attempt to execute SET lc_messages = 'en_US';, the server returns Unknown system variable 'lc_messages' because it simply does not recognize that parameter in its current version. This is not a configuration error on your part; rather, it indicates that the client application (phpMyAdmin) is trying to use a legacy command that the server has deprecated or removed.

To resolve this, you need to understand how phpMyAdmin initializes its connection and where the offending query originates. The issue typically resides in the config.inc.php file, specifically within the $cfg['DefaultLanguage'] setting or potentially in custom initialization scripts included by your installation. While older PHP versions or specific builds of phpMyAdmin might try to force a language change via SQL, modern setups should rely on server variables like lc_ctype, lc_time_names, or the general character set configuration rather than lc_messages.

If you are running a fresh installation on Linux, check your MariaDB/MySQL version first. You can run:

mysql -e "SELECT VERSION();"

If you see a version like 10.5 or higher (or if you are using MariaDB 10.x), the variable is gone. The fix involves ensuring that phpMyAdmin does not attempt to send this SET command on connection. In most cases, updating phpMyAdmin to the latest stable release resolves this automatically, as newer versions have removed the legacy code path attempting to set this variable.

Alternatively, if you are constrained to a specific version of phpMyAdmin or cannot upgrade immediately, you may need to inspect your config.inc.php file for any custom SQL initialization blocks. Look for lines resembling:

$cfg['ExecTimeLimit'] = 0; 
// ... other settings

Ensure there is no manual inclusion of legacy locale setting scripts. If the error persists despite a clean config, the issue might be isolated to your web server environment variables. Sometimes, if LC_MESSAGES is set in the server's environment (e.g., via /etc/default/locale or systemd unit files), it can interact unexpectedly with the PHP CLI tools used to bootstrap the application, though this is less common than a direct SQL query error.

A practical trade-off here is between maintaining backward compatibility and adhering to modern standards. If you are building a new stack, always prefer the latest stable versions of both the database engine and the management tool. Relying on deprecated variables like lc_messages introduces unnecessary friction and potential security risks if those legacy features were ever patched differently in older releases.

For developers maintaining legacy systems where upgrading isn't immediately possible, the workaround is to accept that language switching must happen at the application layer (PHP) or via client-side headers rather than server-side SQL variables. The server will return messages based on its default locale, which you can control by setting lc_ctype and other compatible variables if you strictly need message localization.

Ultimately, this error is a signal that the software stack has evolved past the point where SET lc_messages was valid. By upgrading phpMyAdmin or adjusting your environment to match current server capabilities, you restore functionality without needing to hack the core database configuration.

Our network