我试图用shell脚本自动化数据库创建过程和一个事情,我已经通过一个路径块传递密码psql。
这里是一些来自shell脚本的代码:
这里是一些来自shell脚本的代码:
psql -U $DB_USER -h localhost -c"$DB_RECREATE_sql"
如何以非交互方式将密码传递给psql?
谢谢!
从
official documentation:
原文链接:/bash/392658.htmlIt is also convenient to have a ~/.pgpass file to avoid regularly having to type in passwords. See 07001 for more information.