Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've installed PostgreSQL 9 on Mac OS. I need to change the configuration so that I can access Postgre with the blank password. Searching online yields lots of solutions for older versions of the software, butt I don't know if they apply to the newer version. Many solutions discuss a .conf file of sorts, but the only config files are .conf.sample in the Postgre directories.

My root user now has a blank password. Having this blank password seems to result in an error when I try to connect or set a new password.

I recieve this when trying to connect with the empty password:

psql: fe_sendauth: no password supplied

How can I change the password and/or enable the conf files?

share|improve this question
    
enabling the config file should be as simple as removing the .sample extension and restarting the postgres server. –  Fosco Jul 7 '11 at 13:34

1 Answer 1

Your PostgreSQL administrator account is most likely postgres. You can log in as postgresql administrator by first becoming postgres mac user sudo -i -u postgres. Then you can access PostgreSQL prompt with psql.

To change administrator password: ALTER USER postgres PASSWORD 'somepassword';.

To allow logging in without password, you need to edit pg_hba.conf, which probably resides in/Library/PostgreSQL/9.0/data/pg_hba.conf.

I use ident authentication to allow mac user jkj to log in as PostgreSQL user jkj without password.

# TYPE  DATABASE  USER  CIDR-ADDRESS  METHOD
local   all       jkj                 ident

Remember that you first have to create your username in PostgreSQL. It can be a superuser.

createuser -s jkj
share|improve this answer
    
When trying to run psql, I am prompted for a password. The blank password returns psql: fe_sendauth: no password supplied. –  Moshe Jul 7 '11 at 13:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.