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 behavior of MySQL. See Section 4.1.2.
Variable |
Description |
---|---|
CCX |
Set this to your C++ compiler when running configure. |
CC |
Set this to your C compiler when running configure. |
CFLAGS |
Flags for your C compiler when running configure. |
CXXFLAGS |
Flags for your C++ compiler when running configure. |
DBI_USER |
The default username for Perl DBI. |
DBI_TRACE |
Used when tracing Perl DBI. |
HOME |
The default path for the mysql history file is |
LD_RUN_PATH |
Used to specify where your libmysqlclient.so is. |
MYSQL_DEBUG |
Debug-trace options when debugging. |
MYSQL_HISTFILE |
The path to the mysql history file. |
MYSQL_HOST |
Default hostname used by the mysql command-line prompt. |
MYSQL_PWD |
The default password when connecting to mysqld. Note that use of this is insecure! |
MYSQL_TCP_PORT |
The default TCP/IP port. |
MYSQL_UNIX_PORT |
The default socket; used for connections to localhost. |
PATH |
Used by the shell to find the MySQL programs. |
TMPDIR |
The directory where temporary tables/files are created. |
TZ |
This should be set to your local time zone. See Section A.4.6. |
UMASK_DIR |
The user-directory creation mask when creating directories. Note that this is ANDed with UMASK! |
UMASK |
The user-file creation mask when creating files. |
USER |
The default user on Windows to use when connecting to mysqld. |
Get MySQL Reference Manual now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.