pgadmin给我错误:没有提供密码 [英] pgadmin gives me the error: no password supplied

查看:510
本文介绍了pgadmin给我错误:没有提供密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在linux(kubuntu)和pgadmin3的最新版本上安装了PostgreSQL 9.2,但是当我连接它们时,我遇到了这个错误:

I've installed postgresql 9.2 on linux (kubuntu) and the last version of pgadmin3, but when I connect them I have this error:

发生错误: 连接服务器时出错:fe_sendauth:未提供密码

An error has occurred: Error connecting to the server: fe_sendauth: no password supplied

我该怎么办?

我还在Java中为我的Web应用程序配置了tomcat.实际上,在尝试我的应用程序之前,postgresql一直在工作.

I have also configured tomcat for my web application in java. In fact, postgresql was working before trying my application.

推荐答案

是否需要密码取决于您在

Whether a password is required depends on your settings in pg_hba.conf. And there are different ways you can connect - different settings in pg_hba.conf may apply.

对于连接(服务器")设置中的主机"字段,我引用了pgAdmin 3附带的帮助:

I quote the help shipped with pgAdmin 3 for the "Host" field in the connection ("server") settings:

主机是要联系的机器的IP地址,或者是完整的 合格域名.在基于Unix的系统上,地址字段可能是 留空以使用默认的PostgreSQL Unix Domain Socket 本地计算机,或设置为包含PostgreSQL的备用路径 插座.如果输入路径,则必须以"/"开头.港口 也可以指定数字.

The host is the IP address of the machine to contact, or the fully qualified domain name. On Unix based systems, the address field may be left blank to use the default PostgreSQL Unix Domain Socket on the local machine, or be set to an alternate path containing a PostgreSQL socket. If a path is entered, it must begin with a "/". The port number may also be specified.

如果通过Unix套接字连接,则适用本地"规则. 而通过TCP/IP连接时,主机"(或"hostssl")规则适用.

If you connect via Unix socket the rules for "local" apply. Whereas when connecting via TCP/IP "host" (or "hostssl") rules applies.

如果在pg_hba.conf文件的顶部有这样一行:

If you have a line like this at the top your pg_hba.conf file:

local    all     all     peer

或:

local    all     all     ident

..然后,如果您的系统用户也是"postgres",而数据库用户也是"postgres",那么您也可以在不使用密码的情况下进行本地连接.

.. then you can connect locally without password if your system user is "postgres" and your database user is "postgres", too.

这篇关于pgadmin给我错误:没有提供密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆