Appendix F. Environment Variables

Here is a list of all the environment variables that are used directly or indirectly by MySQL. Most of these can also be found in other places in this manual.

Note that any options on the command-line will take precedence over values specified in configuration files and environment variables, and values in configuration files take precedence over values in environment variables.

In many cases it's preferable to use a configure file instead of environment variables to modify the behaviour of MySQL. Section 4.1.2, “my.cnf Option Files ”.

VariableDescription
CCXSet this to your C++ compiler when running configure.
CCSet this to your C compiler when running configure.
CFLAGSFlags for your C compiler when running configure.
CXXFLAGSFlags for your C++ compiler when running configure.
DBI_USERThe default user name for Perl DBI.
DBI_TRACEUsed when tracing Perl DBI.
HOMEThe default path for the mysql history file is $HOME/.mysql_history.
LD_RUN_PATHUsed to specify where your libmysqlclient.so is.
MYSQL_DEBUGDebug-trace options when debugging.
MYSQL_HISTFILEThe path to the mysql history file.
MYSQL_HOSTDefault host name used by the mysql command-line client.
MYSQL_PS1Command prompt to use in the mysql command-line client. Section 4.8.2, “mysql, The Command-line Tool ”.
MYSQL_PWDThe default password when connecting to mysqld. Note that use of this is insecure!
MYSQL_TCP_PORTThe default TCP/IP port.
MYSQL_UNIX_PORTThe default socket; used for connections to localhost.
PATHUsed by the shell to finds the MySQL programs.
TMPDIRThe directory where temporary tables/files are created.
TZThis should be set to your local time zone. Section A.4.6, “Time Zone Problems ”.
UMASK_DIRThe user-directory creation mask when creating directories. Note that this is ANDed with UMASK!
UMASKThe user-file creation mask when creating files.
USERThe default user on Windows to use when connecting to mysqld.
freelance web developer India web development india website designer | Software developer India