How can we restore mysql database with different name from mysqldump file.
I dont't want to open dump file and edit it. Any other better methods?
MySQL – How to Restore Database with Different Name
backupMySQLmysql-5mysqldumprestore
backupMySQLmysql-5mysqldumprestore
How can we restore mysql database with different name from mysqldump file.
I dont't want to open dump file and edit it. Any other better methods?
Best Answer
You can let mysqldump create the dump in such a way that it does not create or select the database.
EXAMPLE : You are dumping the database db1 and loading it into database db2
This will put in the CREATE DATABASE and the USE commands in the dump
This will not put in the CREATE DATABASE and the USE commands in the dump (this is what you want)
You can load it into another database (such as db2) in one of four(4) ways:
OPTION 1
OPTION 2
OPTION 3
OPTION 4
Give it a Try !!!