Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting started, very basic 2

Status
Not open for further replies.

flugh

Technical User
Aug 23, 2002
655
US
Apologies in advance. The forum FAQ didn't address this, and I'm killing myself trying to figure it out.

I just need to get phpPgAdmin to let me log in. I know it's not postgres-enough for this forum. But I think my problems are related to my users, hosts, etc. If someone would be kind enough to spoonfeed me what to do so that the postgres superuser can log in from localhost without any sort of challenge whatsoever (password, handstamp, secret handshake, anything), I'd be so grateful. Once I can start using phpPgAdmin, it's verbose SQL code presentation with each action will get me through what I have to do (that and a healthy dose of TFM).

I am running both Redhat 9 and Fedora. Postgres is 7.3.4. phpPgAdmin is whatever's newest as of today from the homesite's download page.

Please, feel free to flame, slam, or even help ;-) After reading about the triggers feature, I really would like to try our company DB on postgres and get some of my cruddy php code out of the mainstream and put some of the tidy'ing up on the server ;-)

----
JBR
 
when using it through phpPgAdmin you should not consider that the user is local. I think it is risky to let admin user to connect without password through phpPgAdmin

if we talk about all the servers on one machine and all default settings you can do in conf/confing.inc.php of phpPgAdmin

$conf['servers'][0]['desc'] = 'PostgreSQL';
$conf['servers'][0]['host'] = 'socket';
$conf['servers'][0]['port'] = 5432;
$conf['servers'][0]['defaultdb'] = 'template1';

since the default instalation of postgres doesn't have password for postres and it allows UNIX socket connections it should allow you to connect with user postgres without password (but it is not very wise)

P.S. I havn't tried it this way so maybe I'm missing something ;-))
 
I'm pretty sure that's how I did it except for the 'socket' part (I think I left that blank). I know it's a REALLY BAD THING and will lock it down as soon as I can get it to let me. But this is just crazy. I rm'd the pgsl dir, reinitialized everything (with great help from the folks in #postgresql on freenode.net). Changed the password for postgres, made a new user with password, made a new database, tried to use phpPgAdmin, pgAdmin3 (the one from postgresql.com) and still no luck.

Good grief, I'm not used to being beaten down like this. I'll have to spend some quality RTFM time this evening instead of just skimming through it :)

----
JBR
 
pgAdmin3 defenetly connects through tcp/ip (i.e. not unix socket) so you should enable it from postgresql.conf file (it is quite well documented also to be able to connect from somewhere else you should define your policies in pg_hba.conf
 
I did modify the postgresq.conf file with a 'tcp_enable=true' line. Also modified the /etc/init.d/postgresql script, adding the -i option. It's definitely listening (shows up with netstat). I figure I'm up against some kind of 'user@host identified by password' kind of privileges like mysql has.

Unfortunately that's all on the home devel box and I'm at work now. This will get solved tonight (I hope!).

----
JBR
 
Well, I've failed consistently with the GUI apps. I took to the CLI in created a database 'fred', a user 'fred', and made fred's password 'fred'. If, as postgres, I do 'psql -W -U fred fred' and enter the password 'fred', I STILL get FATAL: IDENT authentication failed for user "fred".

I know the solution is simple, need to do more RTFM. But in the meantime, I've resorted to the evil eye and verbal threats against the server. Fist-shaking-at and physical abuse is soon to follow ;-)

----
JBR
 
You're getting the IDENT failure because you've got a line like:
[tt]local all all ident sameuser[/tt]
in your pg_hba.conf.

This is saying that only the actual user fred can connect to the database, locally, as the PostgreSQL user fred.

I haven't tried this, but it might work out for you to have the line:
[tt]local all all md5[/tt]
before the line I mentioned earlier.
 
Solved. Thanks for the help. Your posts got me more into thinking it through and doing some RTFM. So, I tried 'man pg_hba.conf', but no luck. So I did a 'locate pg_hba.conf', and behold. Besides the one in /var/lib/pgsql I had been screaming at for the last day and a half, there's also one in /var/lib/pgsql/data.

So, you can imagine the rest. Made the above recommended changes, read some docs. What do you know? It works.

I put a:
Code:
local all all trust
in the real pg_hba.conf and it worked like a champ. Thanks for the help. Please don't tell anyone about this, ok? ;-)

----
JBR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top