中国领先的会员管理系统,微卡通会员管理系统,联系QQ:36281733

asp.net ext vc++ gamehack asm vb

天下武功,唯快不破.
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

用pgadmin3 新建服务器出现错误 Peer authentication failed for user "postgres"

在stackoverflow上找到答案,出现此错误的原因是:

Peer authentication 是默认的配置,如果你的计算机用户名和你的postgres数据库名是一样的话,那么就不会出现此错误,不需要为你的数据库设置密码。

还有一种md5 authentication,它需要密码。

而我的计算机用户名和我的数据库名不一致,所以需要把Peer authentication改成md5 authentication,然后给数据库设置密码。

在哪里改?

/etc/postgresql/9.3/main/pg_hba.conf

执行命令

找到下面的一行:

local   all             postgres                                peer

改成

local   all             postgres                                md5

然后restart postgresql server

sudo service postgresql restart

中国领先的会员管理系统,微卡通会员管理系统,联系QQ:36281733