有人有关于如何更改PostgreSQL 9.5的默认端口的想法,我做了以前的版本和我只是修改以下文件相同:
/var/lib/pgsql/9.5/data/postgresql.conf
listen_addresses = '*' port = 4000
/etc/phpPgAdmin/config.inc.php
$conf['servers'][0]['host'] = 'localhost'; $conf['servers'][0]['port'] = 4000;
我正在使用phpPgAdmin从网上检查数据库,它使用默认端口,但它不工作时不使用默认端口,也在terminal我重新启动postgresql服务后得到这个错误:
[root@cos7psql01 system]# su - postgres Last login: Sun Jan 17 12:38:27 CST 2016 on pts/0 -bash-4.2$ psql psql: 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"?
*端口设置为4000只是一个例子。
提前致谢!
您的configuration设置看起来不错,但是如何尝试连接到服务没有。 如果您不指定自定义端口,它将尝试通过默认端口进行连接。
尝试使用-p标志来定义您要通过特定端口进行连接:
psql -p 4000