Creating a local clone of Mysql Database

Times when you want to work with the local copy of the website or application you might want to take the real database and replicate it to provide you with a local copy of the live mysql database.

To do this just execute the following command 

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