I\'m trying to delete all tables from a database except one, and I end up having the following error:
Cannot delete or update a parent row: a foreign key
Drop database exist in all versions of MySQL. But if you want to keep the table structure, here is an idea
mysqldump --no-data --add-drop-database --add-drop-table -hHOSTNAME -uUSERNAME -p > dump.sql
This is a program, not a mysql command
Then, log into mysql and
source dump.sql;