I spend ages trying to work out how to do that, one thing I need to do in Dev and test as well as live environment is copy databases on the same server with the same data to a different name
well after much searching I found this useful page
Duplicating an MySql DB on the same page
but for quick reference here is the Syntax cos I know I will need it again in a few hours
mysqladmin create DB_name -u DB_user --password=DB_pass && mysqldump -u DB_user --password=DB_pass DB_name |mysql -u DB_user --password=DB_pass -h DB_host DB_name
so there you have it renaming a DB made easy
Technorati Tags: Mysql, Duplicating a Database
No comments:
Post a Comment