Postgres HowTo login without password
Procedure
- Create a file in your home directory called
.pgpass
- The contents of this file should take the format:
hostname:port:database:username:password
For example, here the port and database have been left blank:
localhost:*:*:username:passwordYou may have to add a record for
127.0.0.1
as well aslocalhost
.
- Make sure that the file has the correct permissions by running:
chmod 600 .pgpass
- Connect using the following command:
psql -U username -d dbname
Last modified
9 years ago
Last modified on 08/30/16 12:32:08
Note:
See TracWiki
for help on using the wiki.