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.
Apache (5)
CSS (3)
Docker (6)
Git (5)
Go (1)
Hobbies & Toys (8)
HTML (4)
Javascript (5)
jQuery (3)
Linux Ubuntu (46)
Misc (36)
MySQL (3)
Odoo (13)
PHP (3)
Pipeline (1)
Postgresql (6)
Python (13)
Quote (1)
Qweb (1)
Random Word (1)
Smartphone (1)
SQL Server (1)
Tools (7)
Useful Links (46)
Video (3)
VLC (1)
Vue (1)
Web Server (3)
zuka.one
©2011