我最近在更新后在我的Ubuntu 8.04上重新安装了postgresql 8.3.使用过的EnterpriseDB包.我可以在本地连接到数据库,我看到系统数据库postgres但我无法配置它,因为我找不到配置文件.通过整个硬盘搜索,发现只有像pg_hba.conf.sample
postgres *.conf文件在哪里?
我已经安装了 PostgreSQL:
nix-env -iA nixos.postgresql
Run Code Online (Sandbox Code Playgroud)
现在当我使用 时psql,我得到:
psql: error: connection to server on socket "/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
Run Code Online (Sandbox Code Playgroud)
我必须添加一些东西/etc/nixos/configuration.nix吗?
更新
我尝试像此链接那样进行操作(即,将其安装在nix-shell而不是安装在中nix-env),但我仍然遇到相同的错误:
$ nix-shell --pure shell.nix
done
server started
$ psql
psql: error: could not connect to server: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on …Run Code Online (Sandbox Code Playgroud) 我已经在谷歌云上安装了一个 PostgreSQL,我希望能够使用 pg-admin 从我的 PC 远程访问它。
当我尝试连接到我的实例时,我确实收到以下错误:
无法连接到服务器:
无法连接到服务器:连接被拒绝 (0x0000274D/10061) 服务器是否在主机“[我的 VM 实例的外部 IP]”上运行并接受端口 5432 上的 TCP/IP 连接?
我认为这可能是因为谷歌云防火墙阻止了我(也许!),我为我的实例指定了以下防火墙,我使用我的 IP 地址来定义源过滤器:

我是否错过了一些东西,因为我仍然无法访问它,有人可以帮助我吗?我已经不知道了,我已经检查了很多教程,并且我做了很多我应该解决的事情。有人知道吗?