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 June 6th, 2005, 08:37 AM
Registered User
 
Join Date: Apr 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Janardhana M
Default How feasible to connect to multiple dbs in MySQL

Please Let me know How feasible it is to create & use many databases in the MYSQL Database for an application? The Application needs to communicate with these many databases and display them in some pages of it. Since it has to do many connections to use these many databases and use the data from these different databases in a single page Is this a proper way? Does this has any disadvantages?

Please reply. I'm using MySQL for first time.

Janardhana
 
Old June 7th, 2005, 04:42 AM
Friend of Wrox
 
Join Date: Dec 2003
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

You'd normally do this by setting up multiple tables within the same database. So you might have a database called admin with tables called customers, employees and products. This is an absolutely standard thing to do and MySQL should have no problems at all.

If you really need data from seperate databases then this is also possible, but, like you say, you will need to open seperate connections to each one, which may be a little slow for large sites and/or large sets of data.

--
Don't Stand on your head - you'll get footprints in your hair
                                           http://charlieharvey.org.uk
                                              http://charlieharvey.com
 
Old June 7th, 2005, 04:59 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Depending on how you are connecting, you can use the same connection for more than one db and even join tables from separate dbs (obviously the user you connect to mysql with will need rights on the various bases)...
Code:
SELECT myField FROM myDataBase.myTable;
HTH,

Chris






Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to connect to Mysql tp194 Classic ASP Databases 4 November 11th, 2004 12:12 AM
Best way to connect to mySQL netdaviso Java Databases 1 April 5th, 2004 06:37 AM





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