psql:数据库"dbname"的权限被拒绝; (“用户没有CONNECT特权.")/“无法识别的角色选项'connect'"; [英] psql: permission denied for database "dbname" ("User does not have CONNECT privilege.") / "unrecognized role option 'connect'"
问题描述
当我尝试使用psql登录到数据库时,执行以下操作:
when I try to login to my database with psql, doing this:
psql dbname --username=qgis --password
>>(prompts for password, entered password)
psql: FATAL: permission denied for database "gisdatabase"
DETAIL: User does not have CONNECT privilege.
我已经在Google上搜索了有关此简单问题的信息,但没有找到直接谈论此事的人.
I've searched around on Google for information on this simple issue but haven't found anyone directly talking about this.
我尝试这样做:
psql dbname
>>ALTER ROLE qgis WITH CONNECT;
但是出现了这个错误:
ERROR: unrecognized role option "connect"
因此,我再次在这里问了关于stackoverflow的另一个问题.感谢您的宝贵时间
So once again, here I am, asking yet another question on stackoverflow. Thanks for your time folks
推荐答案
您需要授予特权.试试这个:
You need to grant a privilege. Try this:
psql dbname
>> GRANT CONNECT ON DATABASE dbname TO qgis;
我认为您还将需要更多特权. PostgreSQL具有所有DBMS最好的文档页面之一: http://www.postgresql.org /docs/9.0/static/sql-grant.html (您可以在页面顶部选择要使用的postgres版本).
I assume you will also need further privileges. PostgreSQL has one of the best documentation pages of all the DBMSs: http://www.postgresql.org/docs/9.0/static/sql-grant.html (You can choose the postgres version you're using at the top of the page).
这篇关于psql:数据库"dbname"的权限被拒绝; (“用户没有CONNECT特权.")/“无法识别的角色选项'connect'";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!