使用mysqldump
mysqldump -host=host1 -uroot -p123456 -opt sourceDb| mysql -host=host2 -uroot -p123 -C targetDb
tagetDb需要存在