How to delete mysql database through shell command

user90150 picture user90150 · Jan 12, 2010 · Viewed 166.3k times · Source

I use the pylons and sqlalchemy. I constantly update the schema files and delete and recreate the database so that new schema can be made.

Every time I do this by opening the MySql Query Browser and login and delete the database/schema.

How do I delete the MySQL db/schema thorough linux shell commands in Ubuntu Linux?

Answer

Alex Reisner picture Alex Reisner · Jan 12, 2010

Try the following command:

mysqladmin -h[hostname/localhost] -u[username] -p[password] drop [database]