MySQL Environment Variables

MySQL Related Environment Variables

configure用到的环境变量:
CXX     指定C++编译器
CC     指定C编译器
CFLAGS     指定C编译器flags
CXXFLAGS     
指定C++编译器flags

perl用到的环境变量:
DBI_USER     Perl DBI用到的的默认用户名。
DBI_TRACE     Perl DBI用到的trace参数。

MYSQL服务端程序和客户端程序用到的相关环境变量:
HOME     mysql history file 的默认路径 $HOME/.mysql_history.
LD_RUN_PATH     指定 libmysqlclient.so 所在目录.
MYSQL_DEBUG     Debug trace 参数。
MYSQL_GROUP_SUFFIX     类似 --defaults-group-suffix参数的作用,如
For example, the mysql client normally reads the [client] and [mysql] groups. If the --defaults-group-suffix=_other option is given, mysql also reads the [client_other] and [mysql_other] groups. 
MYSQL_HISTFILE     
指定mysql history file 的路径 ,这个设置将覆盖 $HOME/.mysql_history的设置.
MYSQL_HOME     用作服务端,指定 my.cnf 配置文件的目录 (as of MySQL 5.0.3).
MYSQL_HOST     mysql命令行程序使用的默认主机名。
MYSQL_PS1     mysql命令行程序提示符.
MYSQL_PWD     mysql命令行程序使用的默认密码,注意这个变量是非常不安全的,建议的做法不要将密码保存在任何文件中.
MYSQL_TCP_PORT     默认连接的MYSQL TCP端口.
MYSQL_UNIX_PORT     默认连接的 Unix socket file name; used for connections to localhost.
PATH     SHELL环境变量,用于查找MYSQL客户端程序。
TMPDIR     临时文件目录.
TZ     本地时区,如果没有正确设置,在执行now()或UNIX_TIMESTAMP()函数时可能返回错误的值,解决办法:通过设置mysqld_safe的参数--timezone=timezone_name或者在mysqld启动前设置TZ环境变量让mysqld能读到这个变量.
UMASK     创建文件默认掩码
UMASK_DIR     创建目录默认掩码
USER     在 Windows 或 NetWare 系统中,连接 mysqld时使用的默认用户名.

【附】
MYSQL密码使用场景:
1.
Use a  -pyour_pass  or  --password=your_pass  option on the command line.
2.
Use the  -p  or  --password  option on the command line with no password value specified.
3.
Store your password in an option file.
Unix you can list your password in the  [client]  section of the  .my.cnf  file in your home directory:
如:
[client]
password=your_pass

4.
Store your password in the  MYSQL_PWD  environment variable.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值