I was still having some issues after finding this thread, but I have seemed to find a workflow that works for me.
Database Deletion
If you are using MySQL Workbench, you will need to turn SAFE UPDATE off by doing the following 3 steps:
- MySql Workbench > Preferences > SQL EDITOR > (bottom of settings)
- turn the SAFE UPDATE off
- then log out of your connection and reconnect
Steps to start purge database and start new
- Delete all data from tables
(This MySQL script will create a DELETE FROM script for each table in your database.)
SELECT concat('DELETE FROM ',table_schema,'.',table_name,';')
FROM information_schema.table_constraints
WHERE table_schema='!!TABLE_SCHEMA!!';
Copy the output of this and run it. You might need this line-by-line.
- Delete all Foreign Keys from your tables
(This MySql script will create na ALTER TABLE _ DROP FOREIGN KEY script for each table in your database.)
SELECT concat('alter table ',table_schema,'.',table_name,' DROP FOREIGN KEY ',constraint_name,';')
FROM information_schema.table_constraints
WHERE constraint_type='FOREIGN KEY'
AND table_schema='!!TABLE_SCHEMA!!';
Copy the output of this and run it. You might need this line-by-line.
After you've done this, you SHOULD be able to run your DROP DATABASE script.