[英]postgres dropdb with commands in terminal
With Postgres you can add a new database with the following command on Ubuntu: sudo -u postgres /usr/bin/createdb --echo --owner=root foobar
But how can I remove that database? 使用Postgres,您可以在Ubuntu上使用以下命令添加新数据库:
sudo -u postgres /usr/bin/createdb --echo --owner=root foobar
但是如何删除该数据库? sudo -u postgres /usr/bin/dropdb --echo --owner=root foobar
doesn't work, but the dropdb does exists in /usr/bin. sudo -u postgres /usr/bin/dropdb --echo --owner=root foobar
不起作用,但dropdb确实存在于/ usr / bin中。
To drop a PostgreSQL database using the dropdb
executable use: 要使用
dropdb
可执行文件删除PostgreSQL数据库,请使用:
dropdb -h host -p port -U username dbname
Then fill in the password of username
. 然后
username
的密码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.