我在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
答案 0 :(得分:0)
我想您正在尝试连接到在端口5432上运行的协调器:
Unix域套接字上的连接“/tmp/.s.PGSQL.5432”?
但是你的配置文件端口是9999
listen_addresses ='localhost'
port = 9999
max_connections = 100
你应该像这样运行createdb命令。数据库用户必须有权创建db。
./createdb --port=9999 --host=localhost --username=<USERNAME>
答案 1 :(得分:0)
您收到的错误消息可能有很多可能的原因。根据{{1}}的建议,检查配置文件。
否则,我建议您使用pgxc_ctl命令行工具自动生成基本配置文件,以后可以更改/修改。