i have installed postgres 8.3, i entered test as the password while the installation...my problem is that each time i try to access the local database...each time i enter the password...it say database connecting failed...i have tried to change the password via command line but it does not work...even tried to change the configuration file...it does not work...is there any way out for me to make the database work? thanks for your reply...
Password in postgres 8.3 not working
2.6k views Asked by cheerag At
2
There are 2 answers
0
On
In addition to the comment about editing pg_hba.conf, I also had to set a password for myself like in this thread
http://ubuntuforums.org/showthread.php?t=388632
using
ALTER USER postgres WITH ENCRYPTED PASSWORD 'yourhardtoguesspassword';
Often people cannot connect to postgres with a password because it is configured by default to use ident authentication for local connections. Try switching to the postgres system account and connecting with that username. If you get in without a password you're configured for ident. You can also check the authentication methods in pg_hba.conf.
If you want to switch to using passwords for local connections, you can modify the setting in pg_hba.conf. At the bottom of the file there's a section like this:
You can see on the second "local" line I have changed my setting to use md5 authentication instead of ident sameuser. That allows me to log in as any database user from my system account by using the correct password. If you make the same change and restart postgres that might solve your problem.
Be careful not to change the first "local" line. The postgres user is the super user and if you change that authentication mechanism you may not be able to get in.