تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
6 الردود
45383 أدوات العرض

How to drop database from ubuntu terminal.?.

الصورة الرمزية
إهمال
أفضل إجابة
sudo -u postgres dropdb <name>

Explanation:

  • sudo -u postgres: run the next command impersonating the postgres user
  • dropdb <name>: command to drop a PosgreSQL database
الصورة الرمزية
إهمال

What if there is a space character in the database name?

أفضل إجابة

You not just drop it from the webclient. Log in as administrator and drop using master password. Althernatively log into the pgAdmin III (PostgreSQL) and drop it from there. You will need admin access to in both scenarios

الصورة الرمزية
إهمال

yes,kaynis absolutely correct, but if we wish to drop it from the terminal itself, what we have to do?

أفضل إجابة

open your terminal. type the command "dropdb database_name". Using this command you can drop your database

الصورة الرمزية
إهمال
أفضل إجابة

when applied dropdb datname , but " \l "  command shows deleted datname in database list.

الصورة الرمزية
إهمال