Monday, February 06, 2012

Copy MySQL db on the same server

Need to duplicate or backup a db for testing, give this a run.

You can specify a username and pass for both, but I had trouble with it. SO I just used root.. :)

mysqldump -h [server] -u [user] -p[password] DataBaseA | mysql -h [server]  DataBaseB


Stumble Upon CodePyro

1 comment:

Anonymous said...

Thanks for your quick and easy script :)

Post a Comment