Setting the Language for Error Messages
Contents
MariaDB server error messages are by default in English. However, error message localization is supported.
Error message localization is supported for the following languages:
- Czech
- Danish
- Dutch
- English
- Estonian
- French
- German
- Greek
- Hungarian
- Italian
- Japanese
- Korean
- Norwegian
- Norwegian-ny (Nynorsk)
- Polish
- Portuguese
- Romanian
- Russian
- Serbian
- Slovak
- Spanish
- Swedish
- Ukrainian
The actual error message file is errmsg.sys
. Each supported language has its own version of this file stored in its own directory.
Setting the lc_messages
and lc_messages_dir
System Variables
The lc_messages
and lc_messages_dir
system variables can be used to set the server locale used for error messages.
The lc_messages
system variable is specified as the language name. See locales for a list of locales and their related languages.
Any valid locale may be specified. If an error message file for the associated language is not found, then the default locale (English) will be used instead.
The lc_messages_dir
system variable is specified as the path to the directory storing the server's error message files.
These system variables can be specified as command-line arguments to mysqld
or they can be specified in a relevant server option group in an option file. For example:
[mariadb] ... lc_messages=fr_CA lc_messages_dir=/usr/share/mysql
The lc_messages
system variable can also be changed dynamically with SET GLOBAL
. For example:
SET GLOBAL lc_messages='fr_CA';
The lc_messages_dir
system variable can not be changed dynamically.
With the above configuration, error messages would be in French.:
SELECT blah; ERROR 1054 (42S22): Champ 'blah' inconnu dans field list
Setting the --language Option
The --language
option can also be used to set the server's language for error messages, but it is deprecated. It is recommended to set the lc_messages
system variable instead.
The --language
option option can be specified as a language name. See locales for a list of locales and their related languages. For example:
mysqld --language=estonian
The --language
option option can be specified as the path to the directory storing the language's error message file. For example:
mysqld --language=/my/maria-10.0.13/sql/share/danish/
Character Set
The character set that the error messages are returned in is determined by the character_set_results
variable, which defaults to UTF8.