Windows上的Postgres SSPIauthentication

我试图启用Windowsauthentication的Postgresql 9.3(Windows x64 不在域中 ,UAC被禁用,我的帐户是本地pipe理员)。 一键安装程序设置服务器运行NETWORKSERVICE ,我认为是好的。 我跟着这个答案,但它不起作用:

 C:\Program Files\PostgreSQL\9.3\bin>createdb --host=localhost testdb Password: Password: createdb: could not connect to database template1: fe_sendauth: no password supplied 

创build的loginangular色完全按照Windows帐户名称命名 – 仍然没有运气。 我究竟做错了什么? 我在网上find的所有手册不是过时就是不适用(需要AD)。

您尚未将pg_hba.conf的authtypes设置为sspi ,作为您正在使用的用户/主机/数据库组合。

如果有其他人遇到这种情况,我从9.5开始,所以你需要为ipv4和ipv6添加一个可选的参数,以使其工作

include_realm = 0

所以整个事情看起来像

 host all your_username 127.0.0.1/32 sspi include_realm=0