PostgreSQL: non-interactive input password

  1. ~/.pgpass
    hostname:port:database:username:password
    chmod 0600 ~/.pgpass

     

  2. PGPASSWORD=password psql  --host=host --port=5432 --username postgres postgres

     

posted @ 2022-02-10 19:58  ascertain  阅读(27)  评论(0编辑  收藏  举报