Posts Tagged ‘copy database’

Create a copy of a MySQL database on a different server

Sunday, September 20th, 2009

To create a copy of database mysource on Server A as database mydestination on Server B, I follow these two steps:

1) Create database mydestination on Server B.

CREATE database mydestination

2) Then, run this command

mysqldump -hipaddressofserverA -uusernameofserverA -ppasswordofofserverA mysource | mysql -hipaddressofserverB -uusernameofserverB -ppasswordofserverB -C mydestination