Re: Error message "psql: could not connect to server: No such file or directory"

Поиск
Список
Период
Сортировка
От Stefan Schwarzer
Тема Re: Error message "psql: could not connect to server: No such file or directory"
Дата
Msg-id F6D31F0C-B68A-4706-99DD-7F9AB6FBBC77@unep.org
обсуждение исходный текст
Ответ на Re: Error message "psql: could not connect to server: No such file or directory"  (Adrian Klaver <adrian.klaver@gmail.com>)
Ответы Re: Error message "psql: could not connect to server: No such file or directory"  (Stefan Schwarzer <stefan.schwarzer@unep.org>)
Список pgsql-general
>>
>> When I do:     sudo launchctl load /Library/LaunchDaemons/org.postgresql.postgres.plist
>> it says:         org.postgresql.postgres: Already loaded
>>
>> When I do:      /usr/local/pgsql-9.1/bin/initdb -U postgres -D /usr/local/pgsql-9.1/data --encoding=UTF8
--locale=en_US
>> it says:            The files belonging to this database system will be owned by user "xxx".
>>                        This user must also own the server process.
>>                        The database cluster will be initialized with locale en_US.
>>                        The default text search configuration will be set to "english".
>>                        initdb: could not access directory "/usr/local/pgsql-9.1/data": Permission denied
>
>
> So at a guess user 'xxx' is not '_postgres'. You need to be the _postgres user when doing the initdb.
>
>>
>> Same when using "_postgres" instead of "postgres".
>>
>> When I do:     sudo su - _postgres /usr/local/pgsql-9.1/bin/initdb -U postgres -D /usr/local/pgsql-9.1/data
--encoding=UTF8--locale=en_US 
>> it seems to run, but still, same error message "psql: could not connect…."
>
> See, here the initdb worked. Doing the inidtdb is not the same as starting the database. initdb only creates the
initialdatabase cluster. 
>
> To start the database you need to do something like(as _postgres):
>
> /usr/local/pgsql-9.1/bin/pg_ctl start -D /usr/local/pgsql-9.1/data


Thanks so much for those tips.  If I understand it correctly, the commands should be then:

sudo su - _postgres /usr/local/pgsql-9.1/bin/initdb -U postgres -D /usr/local/pgsql-9.1/data --encoding=UTF8
--locale=en_US
sudo su - _postgres /usr/local/pgsql-9.1/bin/pg_ctl start -D /usr/local/pgsql-9.1/data

Although I don't get an error message, I don't have the feeling that it started the server. There is still nothing in
theprocess list, and a normal "psql" results in the same message as before "psql: could not connect…" 

So sorry for bothering you guys… just being really frustrated now…

If you have any ideas, please let me know… :-)

Stef

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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Promoting sync slave to master without incrementing timeline counter?
Следующее
От: Stefan Schwarzer
Дата:
Сообщение: Re: Error message "psql: could not connect to server: No such file or directory"