Setting the Language for Error Messages
MariaDB server error messages are by default in English. You can change this to a number of other languages. As of MariaDB 10.0, error messages are available in 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
, and there is one for each available language, stored in a different directory.
Setting the lc_messages
System Variable
The lc_messages
and lc_messages_dir
system variables can be used to set the server locale used for error messages. lc_messages_dir
is used to provide the directory storing the error message file, and lc_messages
the locale to provide the language. Any valid locale my be given, but if error messages for the associated language are not available, the default (English) will be used. For example, the following will set the error messages to be in French.:
mysqld --lc-messages=fr_CA ... SELECT blah; ERROR 1054 (42S22): Champ 'blah' inconnu dans field list
See locales for a list of locales and their related languages.
lc_messages
can be changed while the server is running and has global and session values, so a user can specify the error messages for their session only to be in particular language by running the SET statement, but lc_messages_dir
can only be set when the server starts.
Setting the --language Option
The --language
can also be used to set the server's language for error messages.
This option was removed from MySQL 5.5.
This option is still available in MariaDB, but it is deprecated.
You can specify just the language, or the directory, for example:
mysqld --language=estonian
or
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.