Postgresql 中文操作指南
21.15. Authentication Problems #
身份验证失败和相关问题通常通过以下错误消息自我显示:
Authentication failures and related problems generally manifest themselves through error messages like the following:
FATAL: no pg_hba.conf entry for host "123.123.123.123", user "andym", database "testdb"
如果您成功联系服务器但它不想与您通信,那么您最有可能获得的就是这个。正如该消息所建议的,服务器拒绝了连接请求,因为它在其 pg_hba.conf 配置文件中找不到与之匹配的条目。
This is what you are most likely to get if you succeed in contacting the server, but it does not want to talk to you. As the message suggests, the server refused the connection request because it found no matching entry in its pg_hba.conf configuration file.
FATAL: password authentication failed for user "andym"
这样的消息表明您已联系服务器,并且它愿意与您通信,但只有在您通过 pg_hba.conf 文件中指定的授权方法后。检查您提供的密码,或者如果投诉提到这些身份验证类型之一,则检查您的 Kerberos 或 ident 软件。
Messages like this indicate that you contacted the server, and it is willing to talk to you, but not until you pass the authorization method specified in the pg_hba.conf file. Check the password you are providing, or check your Kerberos or ident software if the complaint mentions one of those authentication types.
FATAL: user "andym" does not exist
未找到指定的数据库用户名。
The indicated database user name was not found.
FATAL: database "testdb" does not exist
您尝试连接的数据库不存在。请注意,如果您不指定数据库名称,则默认为数据库用户名。
The database you are trying to connect to does not exist. Note that if you do not specify a database name, it defaults to the database user name.