Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> 
>> 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 initial database 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 the process 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
-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux