1

I have a large database, "devDB" that I want to duplicate on the same server to become my live database, "liveDB". Can I make a duplicate without using mysqldump? Last time I used mysqldump it took a really long time. Seems like there could be a quicker way if its just a matter of copying the files. Can you create a new database and copy all the tables?

1
  • mysqldbcopy is the obvious answer. Commented Apr 10, 2018 at 14:31

2 Answers 2

4

If you don't want to use mysqldump, create you databases/schema,

and copy the tables from one DB to the other:

 CREATE TABLE `liveDB.sample_table` SELECT * FROM `devDB.sample_table`;
Sign up to request clarification or add additional context in comments.

Comments

0

Michael's answer above is a good idea if you want to put the newDB in the same MySQL instance as devDB. If you want to put liveDB on a separate Instance, you could use mysqldump to "pipe" the output directly into the "source" of liveDB, so that you could avoid Disk I/O. Also to improve performance, you could disable MySQL's binlog on the target DB while Inserting data.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.