【问题标题】:Can't connect to phppgadmin/无法连接到 phppgadmin/
【发布时间】:2014-09-21 21:44:25
【问题描述】:

我已经从我的 ovh 服务器上的 repo 安装了 php5、apache2、postgresql、phppgadmin..., 并为我的 IP 地址配置了 conf.d/phppgadmin。

order deny,allow
# deny from all
allow from 192.168.0.47 ::1/128
# allow from all

当我转到 my-server/phppgadmin/ 并尝试使用默认的“postgres”登录名、无密码和“root”密码连接自己时,我总是收到失败连接消息...(Échec de la连接)

但是,我设置了线

$conf['extra_login_security'] = false

在 /etc/phppgadmin/config.inc.php 文件中,设置为 false,但没有任何改变...

我还在控制台中创建了一个新用户:

su postgres
createuser myuser

并设置密码:

psql template1
ALTER USER myuser password 'mypassword' 

然后重启 Postgresql:

/etc/init.d/postgresql restart

但我还是无法在phppgadmin/中连接!

非常感谢您的帮助,我不知道出了什么问题...

【问题讨论】:

    标签: sql linux apache postgresql debian


    【解决方案1】:

    如果您可以访问 phppgadmin 登录页面,那么您的 apache 配置没有问题。由于您收到一条连接错误消息,我猜想您的 Apache 正试图以错误的地址访问 Postgres 服务器。

    您可能已经使用公共 IP 在 phppgadmin 配置中设置了数据库,请尝试使用环回 (127.0.0.1)。

    【讨论】:

      【解决方案2】:

      首先找到文件:pg_hba.conf 并编辑/添加。见:“0.0.0.0/0”,责任在你。

      释放一切可能是有风险的: 0.0.0.0/0 将允许所有和所有。

      "local" 仅适用于 Unix 域套接字连接

      local all all trust 
      

      IPv4 本地连接:

      host all all 0.0.0.0/0 trust 
      

      IPv6 本地连接:

      host all all ::1/128 trust 
      

      第二,

      2.1) 文件:/etc/phppgadmin/config.inc.php更改为$conf['extra_login_security'] = false

      2.2)

      如果登录 UNIX 域套接字。 不要更改:/etc/phppgadmin/config.inc.php 并执行命令:usermod -a -G postgres apache

      如果没有登录 _for UNIX 域套接字。_将其更改为 $conf['servers'][0]['host'] = 'localhost';

      最后重启 Apache 和 Postgres 就可以了。访问与

      user:postgres
      pass: NOTHING, no pass.
      

      登录后,更改用户和密码或用户添加您想要的用户/密码。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2014-07-27
        • 1970-01-01
        • 1970-01-01
        • 2021-07-22
        • 2018-02-07
        • 1970-01-01
        • 2019-12-07
        相关资源
        最近更新 更多