Обсуждение:

Поиск
Список
Период
Сортировка

От
"daflmx"
Дата:
Hello,all.
I have installed the postgresql .
$/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data start
LOG:database system was shut down at 2011-11-10 15:36:14 CST
LOG:database system is ready to accept connections
LOG:autovacuum launcher started
 when I check the status of cluster
$/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data status
pg_ctl:server is running(PID 18432)
but why I cannot create a database successfully?
 $/usr/local/pgsql/bin/createdb mydb
createdb:could nto connect to database postgres:could not connect to server:No such file or directory
Is the server running locally and accepting connections on Unix domain socket"/var/run/postgresql/.s.PGSQL.5432"?
Thanks.
 

Re:

От
Craig Ringer
Дата:
On 11/10/2011 05:04 PM, daflmx wrote:

Is the server running locally and accepting connections on Unix domain socket"/var/run/postgresql/.s.PGSQL.5432"?

Well?

Does the socket file exist?

Is PostgreSQL configured to use a different socket - perhaps in /tmp - in postgresql.conf?

I'm guessing you're using `psql' from your OS's packages, which expects to find the PostgreSQL socket in /var/run/postgresql/ , but a PostgreSQL server you installed yourself that puts its socket in /tmp or somewhere else.

Note that you should still be able to connect with `-H localhost' to use TCP/IP rather than unix domain sockets.

--
Craig Ringer