You must replace the database_name in the .sql file.
You can do this from the shell using sed 's/database_name/new_database_name/' dumpFile.sql > newDumpFile.sql
this is the correct answer to my question, but it was provided by "fab" in the comments of another answer.
NOTE . As @Diego noted in the comments, if the string 'database_name' appears elsewhere in this .sql dump, it will also be replaced. You might want to look at the contents of the .sql file with less file_name.sql, and then find / replace it more explicitly.
source
share