- Source host:
mysqldump --skip-opt -e -q --compact --single-transaction -n -t --set-charset [$database_name] [$tables] - Move the dump to destination host (
scp) lockdestination$tablestruncatedestination$tables- `SET SESSION sql_mode='ALLOW_INVALID_DATES'; SET SESSION foreign_key_checks=0; SET SESSION unique_checks=0; SET SESSION autocommit=0;
- Load dump as SQL
source committransactionunlockdestination $tables
Last active
December 25, 2015 03:49
-
-
Save parhamr/6912365 to your computer and use it in GitHub Desktop.
Fast, safe (excepting schema changes), and ugly data transfer between MySQL databases
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment