1. ホーム
  2. postgresql

PostgreSQL学習パート5 - ローカルpsqlのパスワードの有無の設定

2022-02-15 19:58:02
[postgres@single ~]$ psql
psql (9.6.1)
Type "help" for help.

postgres=#
No password is required, you can modify the pg_hba.conf file to require a password.
You can modify the pg_hba.conf file to require a password. The settings will take effect after a reboot.

The following is the case where the password is not required.

[postgres@single pgdata]$ vi pg_hba.conf
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
"pg_hba.conf" 93L, 4466C written                                                                                                                                                                                         
[postgres@single pgdata]$ psql
Password:
psql: fe_sendauth: no password supplied
[postgres@single pgdata]$ pg_ctl stop
LOG: received fast shutdown request
LOG: aborting any active transactions
LOG: autovacuum launcher shutting down
LOG: shutting down
waiting for server to shut down.... LOG: database system is shut down
 done
server stopped  
[postgres@single pgdata]$ pg_ctl start
server starting
[postgres@single pgdata]$ LOG: database system was shut down at 2016-11-17 16:54:37 CST
LOG: MultiXact member wraparound protections are now enabled
LOG: database system is ready to accept connections
LOG: autovacuum launcher started

[postgres@single pgdata]$ psql
psql (9.6.1)
Type "help" for help.

postgres=#