noob postgresql user question

markw-FJ05HQ0HCKaWd6l5hS35sQ at public.gmane.org markw-FJ05HQ0HCKaWd6l5hS35sQ at public.gmane.org
Thu Nov 20 12:29:22 EST 2008


This is really a PHP/Postgresql question.

PHP is running as a scripting language within the Apache server. As such,
PHP will typically be running as the Apache user, and not, mr cool. So, if
the database and the apache user are on the same system and all matches
up, you may be able to connect with the database as is, but I doubt it.

Most CMS environments and PHP projects have you specify a username,
password, and host to connect to the database. There are a few catches
involved:

You need to allow connections to the database via tcp/ip. First. you need
to find postgresql.conf in your data directory, and uncomment the line:
#listen_addresses = '*'          # what IP address(es) to listen on;

This will allow the server to listen on something other than localhost.

Next, in the data directory, you need to find the "pg_hba.conf" file. This
is used to allow or disallow connections and configure authentication
based on network address. It is well commented, so just follow the
directions to enable the connection.

Then HUP or restart PostgreSQL.


Without knowing how you are connecting to PostgreSQL, its hard to give
specifics. If you need more help, email me off-line.





> Date: Thu, 20 Nov 2008 00:39:16 -0500
> From: eric chadbourne <eric-yrHdaQSNc4gdnm+yROfE0A at public.gmane.org>
> Subject: noob postgresql user question
> To: BLU <discuss-mNDKBlG2WHs at public.gmane.org>
> Message-ID: <4924F804.5020204-yrHdaQSNc4gdnm+yROfE0A at public.gmane.org>
> Content-Type: text/plain; charset=UTF-8; format=flowed
>
> i have access to a database via phppgadmin.  i've created a new user and
> now want them to be able to use the db.
>
> GRANT ALL PRIVILEGES
> ON DATABASE all_knowledge
> TO mr_cool;
>
> it's not doing what i suspect.  my php scripts still can't access the db.
>
> what's the magical incantation to give mr_cool unlimited access to
> all_knowledge?
>
> thanks for any tips,
> eric c.





More information about the Discuss mailing list