简体   繁体   English

通过xml将数据从一个数据库传递到另一个数据库

[英]Pass data from one database to another via xml

I have two mysql databases(phpmyadmin) "db_One" and "db_Two" on the same server.Both databases have common table named 'customer'. 我在同一台服务器上有两个mysql数据库(phpmyadmin)“ db_One”和“ db_Two”。两个数据库都有名为'customer'的公用表。 Customer table contains columns ,customer_id and customer_name. 客户表包含列,customer_id和customer_name。 I need to update db_One from db_two every 30 minuets.How can I do that using xml or any other ways to do that? 我需要每隔30分钟从db_two更新一次db_One。如何使用xml或其他任何方式做到这一点? since I am new to xml I have no idea how to do this. 由于我是xml的新手,所以我不知道该怎么做。

i would suggest you use a stored procedure, that way yo can execute the "update" every 30 min, or what you define, take a look here https://dev.mysql.com/doc/connector-net/en/connector-net-tutorials-stored-procedures.html 我建议您使用存储过程,这样您就可以每30分钟执行一次“更新”,或者您定义的内容,在这里看看https://dev.mysql.com/doc/connector-net/en/connector -net-tutorials-stored-procedures.html

for example, First create the procedure 例如,首先创建过程

   CREATE PROCEDURE update_db
   BEGIN
   insert into db_two select *  from db_one
   END 

after that just create a event to call the procedure, for example 之后,只需创建一个事件来调用该过程,例如

       CREATE EVENT update_db
       ON SCHEDULE EVERY 1800 SECOND
       DO
       CALL update_db();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM