我正在尝试在本地机器上使用 pg_dump 工具。但是,当我在终端窗口中键入 pg_dump 时database_name
,我收到以下消息:
pg_dump: [archiver (db)] connection to database "demo" failed:
could not connect to server: No such file or directory
收到此错误消息后,我进入我的postgressql.conf文件(postgres 的配置文件)并将 listen_addresses 设置为*
. 我的连接字符串如下所示:
- Connection Settings -
#listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
#port = 5432 # (change requires restart)
max_connections = 20 # (change requires restart)
# Note: Increasing max_connections costs ~400 bytes of shared memory per
# connection slot, plus lock space (see max_locks_per_transaction).
#superuser_reserved_connections = 3 # (change requires restart)
#unix_socket_directory = '' # (change requires restart)
#unix_socket_group = '' # (change requires restart)
#unix_socket_permissions = 0777 # begin with 0 to use octal notation
# (change requires restart)
#bonjour = off # advertise server via Bonjour
# (change requires restart)
#bonjour_name = '' # defaults to the computer name
# (change requires restart)
然后我重新启动了我的机器,希望当我在pg_dump
控制台中输入时,会发生一些不同的事情。但是,即使重新启动后,我仍然收到无法连接到服务器的错误消息(如上所述)。
为了解决这个问题,我接下来应该尝试哪些步骤?
先感谢您