How do I clone a database?
Basically title. I have a 300MB database that I need to copy into another website for testing. If I do it using phpMyAdmin, I'll always get timeouts. Is there any other way of doing this?
-
If you have shell access it's quite easy: [CODE=bash]mysqldump -u USER-ID -p DATABASE-NAME > DUMP-FILE-NAME
USER-ID is your MySQL user-id DATABASE-NAME is the database name DUMP-FILE-NAME is the path/filename of the dump file you want to create To load the new database (assuming you have already created it) [CODE=bash]mysql -u USER-ID -p DATABASE-NAME < DUMP-FILE-NAME
If you don't have shell access your may need to ask your provider to do this for you.0 -
That made it! Thank you very much for the help :) 0 -
That made it! @ffeingol Thank you very much for the help :)
0 -
I'm glad to see you were able to get this completed! Thanks for the advice @ffeingol 0
Please sign in to leave a comment.
Comments
5 comments