Search Postgresql Archives

Re: Problems logging in

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> I installed the RPMs and the service starts and runs.  I added a user
> and gave it a password, and gave the psql user "postgres" a different
> password.  But I can log on with neither.  No, I didn't forget the
> passwords :-)

when you first start postgres you need to specify the database you are connecting to.

when you connect you could use template1 as it is reinstalled with postgresql:

    psql -U postgres -d template1

However, it would be safer (especially for new db users) to first create a testing database with
the shell command createdb.

    createdb mydb

Of course, for all of this to work your pg_hba.conf file must be working order.
 
> Searching for this sort of problem leads to a lot of the same thing, and
> a lot of different responses about how the pg_hba.conf should read.
> I've tried a huge number of variations, restarting the service between
> each iteration.

you can reference the following page for ideas:
http://www.postgresql.org/docs/7.4/interactive/client-authentication.html#EXAMPLE-PG-HBA.CONF

but to get started I would recommend:
"
 TYPE  DATABASE    USER        IP-ADDRESS        IP-MASK           METHOD
local   all         all                                             trust

"

> Normally, stuff like this is less painful with logs.  But I can find no
> working log file for psql.  In /etc/init.d/postgresql, I found a line
> PGLOG=/dev/null amd replaced it with PGLOG=/var/log/psqllog
> /var/log/psqllog was created but is 0 length after restarting the
> service and a few failed login attempts.  Assuming there's no "This is
> the exact reason why your logins don't work" answer, how do I get
> logging working so as to at least have another clue?

Let preface the next portion of my reply with the fact that I am not positive what I am says is
true for Version 7 of postgresql.

unless you specify otherwise, your log file will be located in your data directory.
the first one is postgresql.log.
The other log files are located in ../data/pg_log/

One point to be aware of,  the type of messages that appear in the depends upon the setting of you
postgresql.conf file.

I hope some of this helps.

Regards,

Richard Broersma Jr.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux