No password settings are required for PostgreSQL guide data

Source: Internet
Author: User
Tags postgresql

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.