0

我在 ubuntu 12.04 中使用 postgres-xl。

当我尝试使用 createuser temp、psql postgres、createdb newdb 错误是

createdb: could not connect to database template1: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

我的设置是

  listen_addresses = 'localhost'
    port = 9999             
    max_connections = 100   
    unix_socket_directory = '/usr/local/pgsql'


# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:         127.0.0.1/32  
host    all             all             0.0.0.0/0            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     apple                                trust
#host    replication     apple        127.0.0.1/32            trust
#host    replication     apple        ::1/128                 trust
4

2 回答 2

0

那么您收​​到的错误消息可能有很多可能的原因。正如Igor检查配置文件所建议的那样。

否则,我建议您使用 pgxc_ctl 命令行工具自动生成基本配置文件,您可以稍后更改/修改。

于 2016-10-06T05:35:36.750 回答
0

我想您正在尝试连接到在端口 5432 上运行的协调器:

Unix域套接字“/tmp/.s.PGSQL.5432”上的连接

但是您在配置文件中的端口是 9999

listen_addresses = 'localhost'
端口 = 9999
max_connections = 100

你应该像这样运行 createdb 命令。数据库用户必须具有创建数据库的权限。

./createdb --port=9999 --host=localhost --username=<USERNAME>
于 2015-09-27T07:45:37.973 回答