如何编写单个查询以从服务器数据库插入本地数据库中选择数据 [英] How to write single query to select data from server database insert into local database
本文介绍了如何编写单个查询以从服务器数据库插入本地数据库中选择数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何编写单个查询
从服务器数据库中选择数据插入到本地数据库中
我曾经使用过联邦,但只有在Internet开启时它才能工作
,我的工作是两个数据库,一个在服务器上,一个在localhost中,并且我必须在一天中插入许多数据输入工作,
所以在回家之前,我必须将dml台架放入服务器中,有时将服务器传送到本地主机上.
在asp.net
How to write single query
to select data from server database insert into local database
i have used federated but its work only when internet is on
,my work is two database, one is on server and one is in localhost,and i have to insert many data entry work in day,
so before going to home i have to make dml staments into server Some times server to local host
how its is possible in asp.net
推荐答案
中如何实现?您可以使用联合表从另一个MySql实例映射"表.之后,可以在INSERT INTO...SELECT...
语句中使用联合表.
有关联合表的信息,请参见如何使用联合表 [ ^ ]
很少有其他链接:
- http://onlamp.com/pub/a/databases/2006 /08/10/mysql-federated-tables.html [ ^ ]
- http://majid.mmxgroup.net/?p=150 [ http://www.mysqlfanboy.com/2010/07/federated-tables/ [ ^ ]
- http ://www.mysqlfaqs.net/mysql-faqs/Table-Types-or-Storage-Engines/Federated-Engine/How-to-create-federated-table-in-MySQL [
You can use federated tables to ''map'' a table from a different MySql instance. After that, you can use the federated table in aINSERT INTO...SELECT...
statement.
For information about federated tables, see How to Use FEDERATED Tables[^]
Few additional links:
- http://onlamp.com/pub/a/databases/2006/08/10/mysql-federated-tables.html[^]
- http://majid.mmxgroup.net/?p=150[^]
- http://www.mysqlfanboy.com/2010/07/federated-tables/[^]
- http://www.mysqlfaqs.net/mysql-faqs/Table-Types-or-Storage-Engines/Federated-Engine/How-to-create-federated-table-in-MySQL[^]
I think those should get you started...
您可以执行以下操作:
在源服务器上选择一个文件:
You can do the following:
Select on the source server to a file:
SELECT * FROM tablename INTO OUTFILE 'filename';
将文件导入您的目标数据库:
Import the file into your destination database:
LOAD DATA INFILE "filename" INTO TABLE tablename;
这篇关于如何编写单个查询以从服务器数据库插入本地数据库中选择数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文