我正在尝试在 Windows 10 上使用 pgbouncer 1.7.2 for PostgreSQL 9.6 设置连接池。
尝试在 cmd 中连接到 pgbouncer
psql -p 6432 -h 127.0.0.1 postgres pgbouncer
给出错误:
psql: server closed the connection unexpectedly Server terminated abnormally before or while processing
端口 6432 正在侦听并在 pg_log 中查看没有错误。
这是我的 pgbouncer.ini 配置文件:
[databases]
mydb = host=127.0.0.1 port=5432 dbname=mydb
[pgbouncer]
logfile = pgbouncer.log
pidfile = pgbouncer.pid
listen_addr = *
listen_port = 6432
auth_type = md5
auth_file = C:/Program Files/pgbouncer-1.7.2-win32/etc/pgbouncer/userlist.txt
admin_users = postgres, lisam
stats_users = stats, root
其中 users.txt 包含“postgres”“some_password”
在 pgbouncer 指南中它说:
从 PostgreSQL 9.0 开始,不再使用文本文件。因此需要生成授权文件。有关从 pg_shadow 表生成身份验证文件的示例脚本,请参见 ./etc/mkauth.py。PostgreSQL MD5-隐藏密码格式:“md5”+md5(密码+用户名)
有谁知道如何手动生成身份验证文件?
任何帮助将非常感激。
谢谢,
丽莎