http://www.zukatsu.tk/
Kategori : Postgresql23 Mei 2018 12:59:56

Postgresql Allow Connection Without Password

Find pg_hba.conf, if you can connect to db template1, you can use this command.

psql -d template1

show hba_file;

Command above will result /etc/postgresql/10/main/pg_hba.conf for default postgresql installation.

Edit pg_hba.conf, search for # IPv4 local connections, insert this value :

host    all             username            127.0.0.1/32            trust

Restart postgresql

sudo service postgresql restart

After that you can connect or execute any psql command without password.

Share : Share Facebook Share Twitter
Kategori : Postgresql23 Mei 2018 12:59:56

zukatsu
©2011