[英]How to transfer data automatically from one MySQL Database to another MySQL Database?
I have two MySQL Database which are in different machines. 我有两个位于不同机器上的MySQL数据库。 I want to transfer data from one Server to another automatically.
我想将数据从一台服务器自动传输到另一台。 Lets say, I want my data transfer to happen each day morning 4:00.
可以说,我希望每天4:00进行数据传输。
Can it be done? 能做到吗 Is there any MySQL built in feature by which we can do it?
有没有内置的MySQL功能可以用来做到这一点?
I want to transfer data from some specific tables not from the whole DB. 我想从某些特定的表而不是从整个数据库传输数据。
mysqldump -uuser -ppass your_db your_table1 > to_sql mysqldump -uuser -ppass your_db your_table1> to_sql
and then use crontab run 然后用crontab运行
mysql -uroot -ppass -hhost < to_sql mysql -uroot -ppass -hhost <to_sql
If you want automated solution handled by MySQL, then it's replication what you need. 如果您希望MySQL处理自动化解决方案,那么它就是您需要的复制。 Since the topic is broad and covered in detail in MySQL manual, I suggest you sit down and read what the documentation says on the topic.
由于该主题内容广泛且在MySQL手册中有详细介绍,因此建议您坐下来阅读文档中关于该主题的内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.