Re: Postgres access using PHP

Поиск
Список
Период
Сортировка
От Chris
Тема Re: Postgres access using PHP
Дата
Msg-id 4.3.2.7.2.20010115095505.00b76430@203.25.173.1
обсуждение исходный текст
Ответ на Postgres access using PHP  (John Poltorak <jp@eyup.org>)
Список pgsql-novice
Or...

In your connect string, use the username "postgres"..

$connect=pg_connect("dbname=database, user=postres")....

check out http://www.php.net/manual/en/function.pg-connect.php for correct
syntax.

HTH


>On Sun, 14 Jan 2001, John Poltorak wrote:
>
> > I am trying to access a Postgres database using PHP from a Web page
> > and it doesn't work.
> >
> > Could anyone shed any light on the problem?
> >
> > This is the error I get - which looks like an authentication problem:-
> >
> > Unable to connect to PostgreSQL server:  FATAL 1:  SetUserId: user
> 'root' is not in 'pg_shadow'
> >
> > What have I overlooked in setting up Postgres for Web access?
>
>You should not be using 'root' to connect to the database, in the first
>place (which looks odd also -- your webserver should be running as
>'nobody', and this should be the default user, not 'root').
>
>You need to create a user (see documentation on CREATE USER) and give them
>access to your database (See documentation on GRANT).  I would also
>recommend giving this user limited access rights -- perhaps just SELECT,
>INSERT and UPDATE.
>
>-- Brett
>                                      http://www.chapelperilous.net/~bmccoy/
>---------------------------------------------------------------------------
>There is only one way to console a widow.  But remember the risk.
>                 -- Robert Heinlein

------------------------
Chris Smith
http://www.squiz.net


В списке pgsql-novice по дате отправления:

Предыдущее
От: "Brett W. McCoy"
Дата:
Сообщение: Re: Postgres access using PHP
Следующее
От: John Poltorak
Дата:
Сообщение: Re: Postgres access using PHP