ptf ptf - 3 months ago 11
MySQL Question

MySQL: When I restore a mysql dump into a new database, does it matter what the new database is called?

If I have a dump of a database created with

mysqldump
, which I want to restore into a new database, created empty, does it matter what the new database is called, compared to the old database?

Will there be any issues if I give the new database a different name from the old database which was used to create the dump?

Answer

No. Most of the time it doesn't matter. You are only creating tables and inserting values. As Green Blade said, If there is any create database query we should remove those lines and use your database name

--
-- Database: `database_name`
--
CREATE DATABASE IF NOT EXISTS `database_name` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `database_name`;

instead of above you should use like below.

--
-- Database: `database_name`
--

USE `database_name`;