# 查询config_file postgres=# show config_file; config_file ------------------------------------- /data/pgsql/13/data/postgresql.conf
# 查询当前数据目录 postgres=# show data_directory; data_directory --------------------- /data/pgsql/13/data
允许远程登陆
1 2 3 4 5 6 7 8 9
vi /var/lib/pgsql/13/data/postgresql.conf
# 打开配置后 :set number # 开启行号显示
# 把第 59 行的 监听地址 改为 * . 默认是注释掉的 59 listen_addresses = '*'# what IP address(es) to listen on; 60 # comma-separated list of addresses; 61 # defaults to 'localhost'; use '*' for all
# TYPE DATABASE USER ADDRESS METHOD # "local" is for Unix domain socket connections only local all all peer # IPv4 local connections: host all all 127.0.0.1/32 ident # IPv6 local connections: host all all ::1/128 ident # Allow replication connections from localhost, by a user with the # replication privilege. #local replication postgres peer #host replication postgres 127.0.0.1/32 ident #host replication postgres ::1/128 ident