Click here to Skip to main content
15,894,343 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Updated 20-Jan-20 4:23am
v2
Comments
[no name] 25-Aug-12 6:39am    
Generally I use an editor and a keyboard to write queries.

You can use federated tables to 'map' a table from a different MySql instance. After that, you can use the federated table in a INSERT 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...
 
Share this answer
 
v2
Comments
Mehdi Gholam 25-Aug-12 6:44am    
5'ed
Wendelius 25-Aug-12 7:05am    
Thanks :)
madhu.gone 25-Aug-12 7:05am    
i read the above link but please can give any article link
Wendelius 25-Aug-12 7:10am    
See the updated answer.
madhu.gone 25-Aug-12 7:31am    
yes i am using above solution but i am getting following error
Unknown storage engine 'FEDERATED'
You can do the following:
Select on the source server to a file:
SQL
SELECT * FROM tablename INTO OUTFILE 'filename';

Import the file into your destination database:
SQL
LOAD DATA INFILE "filename" INTO TABLE tablename;
 
Share this answer
 
Comments
Wendelius 25-Aug-12 7:06am    
That would also work fine.
Espen Harlinn 25-Aug-12 8:42am    
5'ed!
Mehdi Gholam 25-Aug-12 8:45am    
Thanks Espen!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900