我在Windows 10上使用WAMP,我添加了PostgreSQL和PhpPgAdmin,一切都很好。今天,我无法通过PhpPgAdmin或php_pdo web应用程序登录到php_pdo。
我尝试在两个位置编辑pg_hba.conf
( c:\PostgreSQL\pg96\init\
和c:\PostgreSQL\data\pg96\
),并将“方法”更改为trust
(根据多个答案here ),也没有一个CLI答案起作用。
我也重新启动了"WAMP“甚至整个电脑,但是没有运气。
默认密码在postgres
和root
之前有效,但现在不行。
如何重置postgre密码?
更新
运行psql -U postgres
返回;
psql: could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
pg_hba.conf
含量
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# IPv4 local & remote connections:
host all all 127.0.0.1/32 trust
host all all 0.0.0.0/0 trust
# IPv6 local connections:
host all all ::1/128 trust
发布于 2017-09-14 19:37:19
因此,在进行了更多的验证之后,并不是密码出错,而是由于任何原因,PostgreSQL甚至没有运行。窗户是如此的一个皮塔!
最后,从CMD运行pg_ctl -D "C:\PostgreSQL\data\pg96" start
使其正常运行。现在我们来看看明天是否开始..。我想念我的Unix环境。
当上面的代码工作时,它正朝着错误的方向移动。去Control Panel->Administrative Tools->Services
和找到'PostgreSQL .‘。在名单上。右击并打开属性。
我的Startup type:
被设置为'Automatic‘,但它没有启动,我把它设置为'Automatic (延迟启动)’,现在它自动工作了!
https://stackoverflow.com/questions/46223116
复制相似问题