PostgreSQL-致命:用户“ myuser”的身份验证失败 [英] PostgreSQL - FATAL: Ident authentication failed for user "myuser"

查看:146
本文介绍了PostgreSQL-致命:用户“ myuser”的身份验证失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在Ubuntu Box中安装了PostGreSQL,我要做的第一件事就是创建一个数据库。我阅读了文档,它只是说类型createdb。输入该命令后,PostgreSQL给我一个错误:无法连接到数据库postgres:致命:用户 myuser的身份验证失败。我认为这是因为 myuser在数据库中没有正确的管理特权。有没有简单的方法可以添加特权?



谢谢。

解决方案

postgresql通常会创建一个默认用户postgres。您将在安装期间为此用户输入密码。



否则,您可以在pg_hba.conf文件中添加一个条目,以使您的本地主机无需密码即可使用psql命令登录。 / p>

一个示例条目

 托管所有127.0.0.1/ 32信任


I just installed PostGreSQL in my Ubuntu Box, and the first thing I want to do is to create a database. I read the documentation, and it simply says type createdb. Once I typed in that command, PostgreSQL gave me an error: could not connect to database postgres: FATAL: Ident authentication failed for user "myuser". I assume that this is because "myuser" does not have the right administration privileges in the database. Is there an easy way to add that priviliges ?

Thank you.

解决方案

The postgresql usually creates a default user postgres. You would have entered a password during installation for this user. If you remember you can use it.

Otherwise, you can add an entry in the pg_hba.conf file to enable your localhost to login without any password for psql command.

A sample entry would be

host    all         all         127.0.0.1/32          trust   

这篇关于PostgreSQL-致命:用户“ myuser”的身份验证失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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