postgresql Postgres 用户创建数据库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8988495/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 23:17:48  来源:igfitidea点击:

Postgres user create database

postgresql

提问by van

I am unable to create databases using my postgres client with the user I log in as.

我无法使用我的 postgres 客户端和我登录的用户创建数据库。

I am having trouble figuring out how increase the privileges of my user. I have access to the linux server running postgres and am able to use psql to log on as my user and as the postgres user.

我无法弄清楚如何增加我的用户的权限。我可以访问运行 postgres 的 linux 服务器,并且能够使用 psql 以我的用户和 postgres 用户的身份登录。

Can someone tell me what commands I should run to allow my user to create databases on my server through the postgres GUI running on a remote host?

有人能告诉我应该运行哪些命令来允许我的用户通过在远程主机上运行的 postgres GUI 在我的服务器上创建数据库吗?

Many thanks,

非常感谢,

回答by bos

I don′t know of a postgres GUI, but here's how to do it in the psql-console (logged in as the superuser):

我不知道 postgres GUI,但这里是如何在 psql-console 中执行此操作(以超级用户身份登录):

=> ALTER USER your_username CREATEDB;

See http://www.postgresql.org/docs/current/interactive/sql-alteruser.htmlfor more info.

有关更多信息,请参阅http://www.postgresql.org/docs/current/interactive/sql-alteruser.html