【问题标题】:how to configure postgresql / pgbouncer using unix sockets?如何使用 unix 套接字配置 postgresql / pgbouncer?
【发布时间】:2015-05-31 14:01:02
【问题描述】:

无法使用默认的 unix 套接字使最简单的 pgbouncer / postgresql 组合工作。

foo 登录,并使用现有数据库(由foo 创建)bar。这些工作正常:

$ psql 栏 $ psql -U 富吧 $ psql -U foo --密码栏

/etc/pgbouncer/userlist.txt:

“富” “富”

/etc/pgbouncer/pgbouncer.ini:

[数据库] 我的数据库 = [pgbouncer] unix_socket_dir = /var/run/postgresql auth_type = 信任 auth_file = /etc/pgbouncer/userlist.txt

当我尝试使用psql -p 6432 mydbpsql -p 6432 mydb --password 登录时,输入密码后,我得到

psql:错误:用户“foo”的对等身份验证失败

【问题讨论】:

    标签: postgresql pgbouncer


    【解决方案1】:

    使用密码登录 psql 并运行“show hba_file;” vi pg_hba.conf 文件 - 更改“本地”部分以信任用户 foo...

    在运行 pgbouncer 之前运行 export PGPASSWORD='whatever_password_is',

    使用保存的密码创建一个 .pgpass 文件...

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-12-23
      • 2021-08-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-04
      • 2015-05-05
      • 1970-01-01
      相关资源
      最近更新 更多