【发布时间】:2016-04-19 14:58:19
【问题描述】:
我宁愿不使用开放文本密码在 shell 脚本中执行查询。
#!/bin/bash
mysql -uuser -hremotehost -pmypassword -e "update my_table set what_time = NOW()";
有没有办法将mypassword 放入我的本地/etc/my.cnf 文件或其他内容中以使其脱离打开的文本命令行?
假设我的remotehost 不接受 mysql 的无密码。
【问题讨论】: