Tuesday, March 10, 2009

Copy Remote Database to Local Database

Remote mysqldump

Run this one line command as a user:


mysqldump --opt --compress --user=REMOTE_DB_USERNAME --password=REMOTE_DB_PASS --host=REMOTE_DB_HOSTNAME REMOTE_DB_NAME mysql --user=LOCAL_DB_USERNAME --password=LOCAL_DB_PASSWORD --host=LOCAL_DB_HOSTNAME -D LOCAL_DB_NAME -C LOCAL_DB_NAME

Notes: You have to enable remote mysql on remote computer! (To do this you have to add ip address of local computer to remote computer's db remote access ip list)

No comments: