简体   繁体   English

如何自动将数据从一个MySQL数据库传输到另一个MySQL数据库?

[英]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.

相关问题 将数据从一个数据库传输到另一个 MYSQL - Transfer data from one database to another MYSQL Postgres到Mysql-每天将数据从一个数据库传输到另一个数据库 - Postgres to Mysql - Transfer data from one database to another every day 无法将mysql数据从一个数据库传输到另一个数据库 - Can't transfer mysql data from one database to another 如何将数据从一个mysql数据库传输到另一个数据库,以及如何使用python映射具有不同列名的数据 - how to transfer data from one mysql database to another and mapping the data with different column names using python MySQL数据传输/更新到另一个数据库 - MySQL data transfer/update to another database 将数据从一个MYSQL数据库迁移到另一个数据库 - migrate data from one MYSQL database to another 在mysql中将数据从一个数据库插入另一个数据库 - Insert data from one database to another in mysql 如何将表从一个mysql数据库复制到另一个mysql数据库 - How to copy a table from one mysql database to another mysql database 如何将我的MySQL数据库传输到另一台计算机? - How to transfer my MySQL database to another computer? 在MYSQL Workbench中将数据从一个mysql数据库访问到另一个数据库 - Accesing data from one mysql database to another in MYSQL Workbench
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM