MySQL exchange table between two databases

I want to know if my approach is wrong here

I have a simple site on which you can register. It has a main database called USERS, which has a table with a list of all users, and then for each new user a new database is created called DB1,DB2,...,DBn. The reason I did this is because a lot of information is stored for each user, and I thought it would be a better approach. However, now I am faced with a problem that for accessing a table in a database USERSfor external access to user databases for a foreign key I cannot figure out how to do this.

I admit that I do not have much experience with MySQL, so there may be a very bad solution creating a new database for each user. This is true? How efficient is MySQL? Can I, for example, create a list for (presumably) 100,000 users, in which each user has another 100 entries, say, the photos they uploaded.

thank

+3
source share
3 answers

. . ( MyProject). , User, - 100 000 - , . UserPhoto, User, , .

+2

. : http://drupal.org/node/37075

VIEW, USERS .

mysql> use DB1;
mysql> CREATE VIEW users AS
mysql> SELECT *
mysql> FROM USERS.users
+5

db_name.table_name.table_field
+1

All Articles