It is mainly used for PG_DUMP,PSQL data export and import without entering a password, which facilitates the execution of SH script. There are 2 ways, either way.
Method One, set the PG environment variable
export PGPASSWORD=‘yourpassword‘
Method Two, add the User access authentication Trust (to restart) in pg_hba.conf
#允许来自主机192.168.1.110的所有数据库用户无需认证连接所有数据库 设置;TYPE DATABASE USER ADDRESS METHODhost all all 192.168.12.10/32 trust
#允许来自主机 192.168 . 1.110 do not require authentication to connect to the monitor database settings; type database user A ddress method host monitor all 192.168.12.10/32 trust
#允许来自主机192.168.1.110的monitor数据库用户无需认证连接所有数据库 设置;TYPE DATABASE USER ADDRESS METHODhost all monitor 192.168.12.10/32 trust
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
No password settings are required for PostgreSQL guide data