• 远程连接到轻量应用服务器PG数据库


    不建议这样做,但是开发时方便需要。进入正题。

    PG是不支持远程连接的,需要连接直接该参数。

    在其data目录里,有二个配置文件:

    1. pg_hba.conf:配置数据库的访问权限
    2. postgresql.conf:配置数据库服务的相关参数
    #------------------------------------------------------------------------------
    # pg_hba.conf: #------------------------------------------------------------------------------
    # IPv4 local connections: host all all
    127.0.0.1/32 md5 host all all 0.0.0.0/0 md5 # IPv6 local connections: host all all ::1/128 md5 #------------------------------------------------------------------------------ # postgresql.conf:
    #CONNECTIONS AND AUTHENTICATION #------------------------------------------------------------------------------ # - 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)

    别问我为什么这样改,洒家不懂。依葫芦画瓢管用就行。

    然后重启PG服务。

  • 相关阅读:
    南邮NOJ 树木枝干问题I
    【HDOJ】1501 Zipper
    【HDOJ】1556 Color the ball
    【HDOJ】1422 重温世界杯
    【HDOJ】1421 搬寝室
    【HDOJ】1455 Sticks
    【HDOJ】1466 计算直线的交点数
    【HDOJ】3308 LCIS
    【POJ】2528 Mayor's posters
    【POJ】3468 A Simple Problem with Integers
  • 原文地址:https://www.cnblogs.com/usegear/p/16116025.html
Copyright © 2020-2023  润新知