SeunMatt / mysql-backup4j

mysql-backup4j is a library for programmatically exporting mysql databases and sending the zipped dump to email, Amazon S3, Google Drive or any other cloud storage of choice
MIT License
124 stars 71 forks source link

Dropping tables with foreign key constraints fails #21

Open angusvb opened 2 years ago

angusvb commented 2 years ago

When trying to restore a database that has foreign key constraints - with dropExisting enabled - the MysqlImportService returns e.g.: Cannot drop table 'address' referenced by a foreign key constraint 'FKditu6lr4ek16tkxtdsne0gxib' on table 'users'.

Probably needed to disable foreign key checks before executing the drop.