today I had to restore a backup of a database into another database and encountered an interesting problem. Although I provided the name of the new database in the command line, but the sql loaded into the original database and drop all data.
I checked the sql backup and found these lines:
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `original_database` /*!40100 DEFAULT CHARACTER SET latin1*/;
I recommend that you remove them from the backup because it is very dangerous, it is easy to accidentally drop the current live database and overwrite with the backup if you would like to load the backuped sql file into a new database.