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.