Version 1 (modified by 9 years ago) ( diff ) | ,
---|
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
Note:
See TracWiki
for help on using the wiki.