convert system from not using a password to using passwords

Поиск
Список
Период
Сортировка
От Marc Fromm
Тема convert system from not using a password to using passwords
Дата
Msg-id SN1PR0201MB1566F7E7DC23E60A718A13279D150@SN1PR0201MB1566.namprd02.prod.outlook.com
обсуждение исходный текст
Ответы Re: convert system from not using a password to using passwords  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: convert system from not using a password to using passwords  (Keith <keith@keithf4.com>)
Список pgsql-admin

I inherited a setup where php pages use postgresql databases. Currently the php pages use pg_connect with user=postgres and password=’’. I want to change this to using a different user that has a password.

 

1.       First created a user that can access all the databases:

postgres=# CREATE USER web_u1 with PASSWORD '********' CREATEUSER;

 

2.       Next I changed pg_hba.conf with the entries

# "local" is for Unix domain socket connections only

#local   all         all                               trust

local   all         all                               md5

 

# IPv4 local connections:

#host    all         all         127.0.0.1/32          trust

host    all         all         127.0.0.1/32          md5

 

# IPv6 local connections:

#host    all         all         ::1/128               trust

host    all         all         ::1/128               md5

 

3.       I changed the php code as follows

$conn = pg_connect("host=localhost port=5432 user=web_u1 dbname=db_name password='********'");

 

This all worked. My problem is the obvious, all pages are broken until I update each page that has a pg_connect statement. Is there a way to configure the pg_hba.conf file to accept the “user=postgres with no password,” if “user=web_u1” with a password is not provided?

 

Also is there anything I missed in my steps with creating the user with a password and updating the pg_hba.conf file?

 

Thanks

 

Marc

 

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

Предыдущее
От: Dorian Machado
Дата:
Сообщение: Re: interactif pg environnement script
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: convert system from not using a password to using passwords