postgresql 错误:必须是数据库的所有者

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36727385/
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-10-21 02:14:44  来源:igfitidea点击:

Error:must be owner of database

databasepostgresqlpsql

提问by mal danel

I want to delete a particular database which I have named 'mysitedb' so what I did is I opened the terminal and entered the command 'dropdb mysitedb' then the error 'ERROR: must be owner of database mysitedb' pops up. I know the username and pass for the particular database but don't have a clue on deleting it. I am new to postgresql. be gentle :P

我想删除一个名为“mysitedb”的特定数据库,所以我所做的是打开终端并输入命令“dropdb mysitedb”,然后弹出错误“错误:必须是数据库 mysitedb 的所有者”。我知道特定数据库的用户名和密码,但不知道删除它。我是 postgresql 的新手。温柔点:P

回答by paulsm4

Q: I want to delete a particular database which I have named 'mysitedb' so what I did is I opened the terminal and entered the command 'dropdb mysitedb' then the error 'ERROR: must be owner of database mysitedb' pops up...

问:我想删除一个名为“mysitedb”的特定数据库,所以我所做的是打开终端并输入命令“dropdb mysitedb”,然后弹出错误“ERROR: must be owner of database mysitedb”.. .

OK - this means you don't have the right credentials. You need the username/password of a postgresql user with permissions to delete that database.

好的 - 这意味着您没有正确的凭据。您需要具有删除该数据库权限的 postgresql 用户的用户名/密码。

NOTE: I know the user who owns it. Also I know the password.

注意:我知道拥有它的用户。我也知道密码。

WHAT??? Then who were you logged in as when you got the permissions error????

什么???那么当您收到权限错误时,您以谁的身份登录????

ANYWAY: you want the dropdbcommand:

无论如何:你想要dropdb命令:

dropdb -U db_owner_username -i [-h host] mysitedb

dropdb -U db_owner_username -i [-h host] mysitedb

Here is the Postgresql documentation page:

这是 Postgresql 文档页面: