PostgreSql 改为全网段可以访问数据库
PostgreSql 改为全网段可以访问数据库
在安装目录下打开文件,我安装在D盘中的文件路径为:
"D:\Program Files\PostgreSQL\18\data\pg_hba.conf"
把文件使用记事本打开,拉到最下面,可以看到如下
# "local" is for Unix domain socket connections only local all all scram-sha-256 # IPv4 local connections: host all all 127.0.0.1/32 scram-sha-256 # IPv6 local connections: host all all ::1/128 scram-sha-256 # Allow replication connections from localhost, by a user with the # replication privilege. local replication all scram-sha-256 host replication all 127.0.0.1/32 scram-sha-256 host replication all ::1/128 scram-sha-256
第4行中的 127.0.0.1/32 就是ipv4可以访问的地址,我们把第4行改为如下
# "local" is for Unix domain socket connections only local all all scram-sha-256 # IPv4 local connections: host all all 0.0.0.0/0 scram-sha-256 # IPv6 local connections: host all all ::1/128 scram-sha-256 # Allow replication connections from localhost, by a user with the # replication privilege. local replication all scram-sha-256 host replication all 127.0.0.1/32 scram-sha-256 host replication all ::1/128 scram-sha-256
然后保存文件,重启数据库服务或者重启电脑即可
如有问题请联系QQ:
var d=["1","2","3","4","5","6","7","8","9"];
var pass=d[8]+d[6]+d[0]+d[8]+d[2]+d[0]+d[4]+d[3]+d[2];
源代码(github)包(NuGet)关注:ping9719

浙公网安备 33010602011771号