By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,306 Members | 1,621 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,306 IT Pros & Developers. It's quick & easy.

How to connect two databases on two hosts?

P: 344

How can I connect two databases on two different host? I'm trying to copy some data from a table#1-database#1 to table#1-database#2.

Thanks in advanced!
Mar 2 '11 #1
Share this Question
Share on Google+
2 Replies

Expert 100+
P: 250
Assuming that this is a "one off" task, the simplest way is to create an export of a query (using phpmyadmin) from the source host/table, transfer it to the host/target, and then import into the target/table.

There are a number of other ways, but IMHO this is the simplest.
Mar 3 '11 #2

P: 344
Thanks a lot dgreenhouse for your help!

I'm trying to create a program to do the copying on a condition for more than one time where the source is updated every while.

In more details:
1. There is database#1 has table#1 where data is inserted every moment.
2. There is database#2 has table#2.
3. I wan to copy some fields from db#1 tbl#1 to db#2 tbl#1. Not only for one time but will do again for the new data that inserted every while.
4. I'm doing that using C#.

I'm thinking, I will copy the data to the application using a connection then insert these data to the second database through a second connection. Is there a more simple solution where I can connect directly the two databases?

Mar 3 '11 #3

Post your reply

Sign in to post your reply or Sign up for a free account.