All pages
Powered by GitBook
1 of 1

Loading...

Setting the Language for Error Messages

Learn how to configure the lc_messages and lc_messages_dir system variables to display server error messages in a supported local language.

MariaDB server error messages are by default in English. However, MariaDB server also supports error message localization in many different languages. Each supported language has its own version of the error message file called errmsg.sys in a dedicated directory for that language.

Supported Languages for Error Messages

Error message localization is supported for the following languages:

  • Bulgarian

  • Chinese (from , , , , )

  • Czech

  • Danish

  • Dutch

  • English

  • Estonian

  • French

  • Georgian (from )

  • German

  • Greek

  • Hindi

  • Hungarian

  • Italian

  • Japanese

  • Korean

  • Norwegian

  • Norwegian-ny (Nynorsk)

  • Polish

  • Portuguese

  • Romanian

  • Russian

  • Serbian

  • Slovak

  • Spanish

  • Swahili (from )

  • Swedish

  • Ukrainian

Setting the lc_messages and lc_messages_dir System Variables

The and system variables can be used to set the used for error messages.

The system variable can be specified as a name. The language of the associated will be used for error messages. See for a list of supported locales and their associated languages.

The system variable is set to en_US by default, which means that error messages are in English by default.

If the system variable is set to a valid name, but the server can't find an for the language associated with the , then the default language will be used instead.

This system variable can be specified as command-line arguments to or it can be specified in a relevant server in an . For example:

The system variable can also be changed dynamically with . For example:

If a server has the system variable set to the fr_CA locale like the above example, then error messages would be in French. For example:

The system variable can be specified either as the path to the directory storing the server's or as the path to the directory storing the specific language's .

The server initially tries to interpret the value of the system variable as a path to the directory storing the server's . Therefore, it constructs the path to the language's by concatenating the value of the system variable with the language name of the specified by the system variable .

If the server does not find the for the language, then it tries to interpret the value of the system variable as a direct path to the directory storing the specific language's .

This system variable can be specified as command-line arguments to or it can be specified in a relevant server in an .

For example, to specify the path to the directory storing the server's :

Or to specify the path to the directory storing the specific language's :

The system variable can not be changed dynamically.

Setting the --language Option

The option can also be used to set the server's language for error messages, but it is deprecated. It is recommended to set the system variable instead.

The option can be specified either as a language name or as the path to the directory storing the language's . See for a list of supported locales and their associated languages.

This option can be specified as command-line arguments to or it can be specified in a relevant server in an .

For example, to specify a language name:

Or to specify the path to the directory storing the language's :

Character Set

The character set that the error messages are returned in is determined by the variable, which defaults to UTF8.

This page is licensed: CC BY-SA / Gnu FDL

10.6.8
MariaDB 10.11.3
lc_messages
lc_messages_dir
server locale
lc_messages
locale
locale
Server Locales
lc_messages
lc_messages
locale
error message file
locale
mariadbd
option group
option file
lc_messages
SET GLOBAL
lc_messages
lc_messages_dir
error message files
error message file
lc_messages_dir
error message files
error message file
lc_messages_dir
locale
lc_messages
error message file
lc_messages_dir
error message file
mariadbd
option group
option file
error message files
error message file
lc_messages_dir
--language
lc_messages
--language
error message file
Server Locales
mariadbd
option group
option file
error message file
character_set_results
[mariadb]
...
lc_messages=fr_CA
SET GLOBAL lc_messages='fr_CA';
SELECT blah;
ERROR 1054 (42S22): Champ 'blah' inconnu dans field list
[mariadb]
...
lc_messages_dir=/usr/share/mysql/
[mariadb]
...
lc_messages_dir=/usr/share/mysql/french/
[mariadb]
...
language=french
[mariadb]
...
language=/usr/share/mysql/french/
MariaDB 10.4.25
10.5.16
10.7.4
10.8.3
MariaDB 11.1.2