Import from one db to another fails
You can add this to the top of your .sql file, then try loading it again.

SET FOREIGN_KEY_CHECKS = 0;


This will permit MySQL to load the data while ignoring the foreign key checks.

Since CiviCRM uses foreign key checks, this is a good idea only if the checks throw errors when loading the DB but not when using CiviCRM afterwards.

Alternatively, to ensure foreign key integrity and handle existing tables not wanting to be deleted, prefix your .sql with

DROP DATABASE nameofdb;
CREATE DATABASE nameofdb;


(where nameofdb is your actual DB name of course).