Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > MySQL
|
MySQL General discussion about the MySQL database.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the MySQL section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 11th, 2003, 05:03 AM
Registered User
 
Join Date: Sep 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default MySQL database communication

can we communicate between two different mysql database servers installed in two different directories on sam eor different drives. If yes, then how, plz help?

 
Old September 11th, 2003, 12:29 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What do you mean communicate between two databases? What specifically do you want to do?


Take care,

Nik
http://www.bigaction.org/
 
Old September 11th, 2003, 11:58 PM
Registered User
 
Join Date: Sep 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I mean to say can we connect two different MySQL database servers installed and then combine them to retreive the queries from the tables installed differently on each of them.

 
Old September 12th, 2003, 01:22 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No, not in a single query. Whenever you connect to a database, you have a single connection to a single server. Once you're connected, you have to select the database you wish to work with. All tables within that database are available for you to query.

If you want to query a different database on the same server, you have to create a new connection to that database. Same thing goes for a different server, definitely.

In PHP, for example, you have to mysql_connect() to a server and mysql_select_db() to use a specific database before any queries can be made.

When using the mysql commandline client, you have to specify the host on the commandline to connect to a server, and then you have to select the database you want to use.


The only thing I can suggest is to write a simple program to create a new database with new tables to hold the relevant data you want from the other databases. A bit out of the way, I know, but I don't know of another method.



Take care,

Nik
http://www.bigaction.org/





Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL database neil.abachi07 MySQL 13 October 8th, 2007 02:23 PM
Flash-database communication flashlinksol SQL Language 0 October 18th, 2005 10:19 AM
Need Help Connecting to mySQL Database! jehchoi1 PHP Databases 6 April 21st, 2005 09:28 AM
MySQL Database Connection jayteee Dreamweaver (all versions) 0 December 11th, 2004 11:27 PM
Shifting of MySQL Whole Database. kengyiam MySQL 2 September 9th, 2003 03:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.