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 o
[root@host]# mysqladmin -u root -p drop [DB]
Enter password:******
In general, you can pass any query to mysql
from shell with -e option.
mysql -u username -p -D dbname -e "DROP DATABASE dbname"
MySQL has discontinued drop database command from mysql client shell. Need to use mysqladmin to drop a database.
Try the following command:
mysqladmin -h[hostname/localhost] -u[username] -p[password] drop [database]
Another suitable way:
$ mysql -u you -p
<enter password>
>>> DROP DATABASE foo;
If you are tired of typing your password, create a (chmod 600) file ~/.my.cnf
, and put in it:
[client]
user = "you"
password = "your-password"
For the sake of conversation:
echo 'DROP DATABASE foo;' | mysql