zoukankan      html  css  js  c++  java
  • Ubuntu下访问Windows中Postgresql

      因为项目的原因,需要将Ubuntu中的一些信息记录到Windows中的Postgresql数据库中,查看网上信息,最后成功了,特地记录以下,需要以下步骤:

    (1)在Windows中Postgresql目录下找到pg_hba.conf文件,并做修改。

      在此文件中添加一行,格式参考下面七种:
    local      database  user  auth-method  [auth-option]
    host       database  user  CIDR-address  auth-method  [auth-option]
    hostssl    database  user  CIDR-address  auth-method  [auth-option]
    hostnossl  database  user  CIDR-address  auth-method  [auth-option]
    host       database  user  IP-address  IP-mask  auth-method  [auth-option]
    hostssl    database  user  IP-address  IP-mask  auth-method  [auth-option]
    hostnossl  database  user  IP-address  IP-mask  auth-method  [auth-option]
      如host all all 192.168.1.0/24 md5,表示允许网段192.168.1.0上的所有主机使用所有合法的数据库用户名访问数据库,并提供加密的密码验证
    (2)在Windows中Postgresql目录下找到postgresql.conf文件,修改postgresql.conf文件,将数据库服务器的监听模式修改为监听所有主机发出的连接请求。
      将文件中listen_addresses=’localhost’更改为listen_addresses=’*‘
      
      做完以上两步,重启数据库服务,检查是否能够正常访问,不行的话检查防火墙设置。
    (3)在Windows防火墙页面,选择左侧高级设置,添加规则。

    转载于:https://www.cnblogs.com/HelloMoying/p/6421827.html

  • 相关阅读:
    LeetCode 297. 二叉树的序列化与反序列化
    LeetCode 14. 最长公共前缀
    LeetCode 1300. 转变数组后最接近目标值的数组和
    bigo一面凉经
    LeetCode 128.最长连续序列
    LeetCode中二分查找算法的变种
    LeetCode 93. 复原IP地址
    LeetCode 1004. 最大连续1的个数 III
    LeetCode 1282. 用户分组
    多线程理解
  • 原文地址:https://www.cnblogs.com/twodog/p/12141258.html
Copyright © 2011-2022 走看看