Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql Can';t连接到phppgadmin/_Sql_Linux_Apache_Postgresql_Debian - Fatal编程技术网

Sql Can';t连接到phppgadmin/

Sql Can';t连接到phppgadmin/,sql,linux,apache,postgresql,debian,Sql,Linux,Apache,Postgresql,Debian,我已经安装了php5、apache2、postgresql、phppgadmin。。。从我的ovh服务器上的repo, 并为我的Ip地址配置conf.d/phppgadmin order deny,allow # deny from all allow from 192.168.0.47 ::1/128 # allow from all 当我转到我的服务器/phppgadmin/并尝试使用默认的“postgres”登录连接自己时,不使用密码和“root”密码,我总是会收到失败连接消息。。。(埃

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

order deny,allow
# deny from all
allow from 192.168.0.47 ::1/128
# allow from all
当我转到我的服务器/phppgadmin/并尝试使用默认的“postgres”登录连接自己时,不使用密码和“root”密码,我总是会收到失败连接消息。。。(埃切德拉康涅西翁)

然而,我设定了底线

$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/中连接


非常感谢您的帮助,我不知道怎么了…

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


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

首先查找文件:
pg_hba.conf
并编辑/添加。参见:“0.0.0.0/0”,责任属于您

发布所有内容都可能有风险: 0.0.0.0/0将允许all和all

“本地”仅用于Unix域套接字连接

local all all trust 
IPv4本地连接:

host all all 0.0.0.0/0 trust 
host all all ::1/128 trust 
IPv6本地连接:

host all all 0.0.0.0/0 trust 
host all all ::1/128 trust 
第二,

2.1)文件:
/etc/phppgadmin/config.inc.php
更改为
$conf['extra\u login\u security']=false

(2.2)

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

如果未登录,请登录UNIX域套接字。\u将其更改为
$conf['servers'][0]['host']='localhost'

最后重新启动Apache和Postgres,它就会工作。访问

user:postgres
pass: NOTHING, no pass.
登录后,更改用户和密码或用户添加所需的用户/密码