Create copy/duplicate of MySQL database

By , May 23, 2013 11:48 am

Let’s say the original database is db1 and the duplicate is db2

– Create a new database, db2
– Run following command:

mysqldump -h [server] -u [user] -p[password] db1 | mysql -h [server] -u [user] -p[password] db2

Note: there is no space between -p and the password.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Webnews
  • Digg
  • del.icio.us
  • Reddit
  • Bloglines
  • LinkedIn
  • YahooMyWeb
  • Facebook
  • Google Bookmarks
  • Mixx
  • MySpace
  • Technorati
  • TwitThis

Leave a Reply

*

Panorama Theme by Themocracy