MySQL Environment Variables

Let us understand the environment variables that are directly or indirectly used by MySQL. We will name the environment variable and give a description about it in the below section −

  • AUTHENTICATION_LDAP_CLIENT_LOG − It is the client-side LDAP authentication logging level.

  • AUTHENTICATION_PAM_LOG − It is the PAM authentication plugin debug logging settings.

  • CC − It is the name of your C compiler (to run CMake).

  • CXX − It is the name of your C++ compiler (to run CMake).

  • CC − It is the name of your C compiler (to run CMake).

  • DBI_USER − It is the default user name for Perl DBI.

  • DBI_TRACE − It is the trace option for Perl DBI.

  • HOME − It is the default path for the mysql history file is $HOME/.mysql_history.

  • LD_RUN_PATH − It is the used to specify the location of

  • LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN − It enables mysql_clear_password authentication plugin;

  • LIBMYSQL_PLUGIN_DIR − It is the directory in which client plugins can be looked for.

  • LIBMYSQL_PLUGINS − It is used to preload the client plugins.

  • MYSQL_DEBUG − It helps debug trace options when debugging.

  • MYSQL_GROUP_SUFFIX − It is the option group suffix value (such as specifying --defaultsgroup-suffix).

  • MYSQL_HISTFILE − It is the path to the mysql history file. If this variable is set, its value will be overridden by the default for $HOME/.mysql_history.

  • MYSQL_HISTIGNORE − It is the pattern that specifies statements which indicates that mysql should not log to $HOME/.mysql_history, or syslog if --syslog has been prpvided given.

  • MYSQL_HOME − It is the path to the directory wherein the server-specific my.cnf file are present.

  • MYSQL_HOST- It is the default host name used by the mysql command-line client.

  • MYSQL_OPENSSL_UDF_DH_BITS_THRESHOLD − It is the maximum key length for create_dh_parameters().

  • MYSQL_OPENSSL_UDF_DSA_BITS_THRESHOLD − it is the maximum DSA key length for create_asymmetric_priv_key().

  • MYSQL_OPENSSL_UDF_RSA_BITS_THRESHOLD − It is the maximum RSA key length for create_asymmetric_priv_key().

  • MYSQL_PS1 − It is the command prompt which is used in the mysql command-line client.

  • MYSQL_PWD − It is the default password used while connecting to mysqld. This is not a secure connection.

  • MYSQL_TCP_PORT − It is the default TCP/IP port number.

  • MYSQL_TEST_LOGIN_FILE − It is the name of the .mylogin.cnf login path file.

  • MYSQL_UNIX_PORT − It is the default Unix socket file name; used for connections to localhost.

  • MYSQLX_TCP_PORT − It is the X Plugin default TCP/IP port number.

  • MYSQLX_UNIX_PORT − It is the X Plugin default Unix socket file name It is used for connections to localhost.

  • NOTIFY_SOCKET − It is the socket used by mysqld to communicate with the systemd.

  • PATH − It is used by the shell to find MySQL programs.

  • PKG_CONFIG_PATH − It is the location of mysqlclient.pc pkg-config file.

  • TMPDIR − It is the directory wherein the temporary files are created.

  • TZ − It is used to set to your local time zone.

  • UMASK − It is the user-file creation mode when creating files.

  • UMASK_DIR − It is the user-directory creation mode while creating directories.

  • USER − It is the default user name on Windows when connecting to mysqld.

Options on command line have greater precedence over values specified in option file and environment variables. The values in option file have greater precedence over values in environment variables. In most cases, it is preferred to use option file instead of environment variables. This way, the behaviour of MySQL can be modified.

Using MYSQL_PWD is considered to be an insecure way to specify the MySQL password, and should be avoided. MYSQL_PWD has been deprecated and maybe removed in the upcoming versions.

Updated on: 08-Mar-2021

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started