0

Hello,

I have two databases in MySql...
Master database and child database..
In master database there are two tables...Accountant(Having Primary Key AccountID) and Client(Having Primary Key ClientID)...
Now for each client master database remains same and child database is created for each client...
In child database,there are several tables related to Sales,Purchase,etc..
Now in child databases, I want to use AccountID and ClientID as foreign keys.....

How to connect these two databases?

Edited by riya_developer: n/a

3
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by urtrivedi
0

You can prefix the table name with the (dot-terminated) database name in queries, thus allowing for joins across database limits. To the beste of my knowledge, you cannot create foreign keys, though, which are maintained by InnoDB.

0

Ya using joins I can do...but I don't want to use joins...
Like in a single database,we set foreign keys between tables...In that way I want to set relationship between tables of two different databases...
Can u tell me how it is maintained by InnoDB? I dont's know much about that...

Edited by riya_developer: n/a

0

You seems to be confused or your you have not explained your case exactly.
So what is relation between account and client, that will decide how to use accountid and clientid in other tables

Do you have many client for one account?
or do you have one client may be linked with many accounts?
or one account for one client?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.