mysql restore and overwrite

mysql, overwrite, restore

Solution

It sounds like your dump file has a `CREATE DATABASE` in it. If so, you should drop the database before you load the dump file:

$ mysqladmin -u root -p drop database

Now you can load the dump file:

$ mysql -u root -p < plasesavetheday.sql

Of course, you might want to backup the database first, just in case!

Problem

I have a backup of my entire host 11 DB and some tables. I messed some stuff up and I want to restore and while restoring OVERWRITE. `mysql -u root -p < plasesavetheday.sql` I get errors about database existing and Duplicate entry '11' for key 'id'. how can I tell the import or edit the file to be an overwtire. thanks

Original source