This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-23. For the latest, interactive version please visit https://mariadb.com/kb/.

MariaDB Environment Variables

MariaDB makes use of numerous environment variables that may be set on your system. Environment variables have the lowest precedence, so any options set on the command line or in an option file will take precedence.

It's usually better not to rely on environment variables, and to rather set the options you need directly, as this makes the system a little more robust and easy to administer.

Here is a list of environment variables used by MariaDB.

Environment VariableDescription
CXXName of the C++ compiler, used for running CMake.
CCName of the C compiler, used for running CMake.
DBI_USERPerl DBI default username.
DBI_TRACEPerl DBI trace options.
HOMEDefault directory for the mysql_history file.
MYSQL_DEBUGDebug trace options used when debugging.
MYSQL_GROUP_SUFFIXIn addition to the given option groups, also read groups with this suffix.
MYSQL_HISTFILEPath to the mysql_history file, overriding the $HOME/.mysql_history setting.
MYSQL_HOMEPath to the directory containing the my.cnf file used by the server.
MYSQL_HOSTDefault host name used by the mariadb command line client.
MYSQL_PS1Command prompt for use by the mariadb command line client.
MYSQL_PWDDefault password when connecting to mysqld. It is strongly recommended to use a more secure method of sending the password to the server.
MYSQL_TCP_PORTDefault TCP/IP port number.
MYSQL_UNIX_PORTOn Unix, default socket file used for localhost connections.
PATHPath to directories that hold executable programs (such as the mariadb client, mariadb-admin), so that these can be run from any location.
TMPDIRDirectory where temporary files are created.
TZLocal time zone.
UMASKCreation mode when creating files. See Specifying Permissions for Schema (Data) Directories and Tables.
UMASK_DIRCreation mode when creating directories. See Specifying Permissions for Schema (Data) Directories and Tables.
USEROn Windows, up to MariaDB 5.5, the default user name when connecting to the mysqld server. API GetUserName() is used in later versions.
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.