Page 1 of 1

Databases being shared across localhost and virtual servers

PostPosted: 17. October 2004 05:45
by insomn3ak
I've set up 3 virtual hosts in the config.inc.php file. I've set the default server to 'localhost' so it automatically comes up in phpMyAdmin. I see the demo databases in phpMyAdmin for 'localhost' as well.

Here's the problem...
I create a new database and populate it with test data. I'm connecting to 'localhost' to create the new database in. However, when I look in phpMyAdmin, I see the new database under ALL the servers. My understanding was that I should only see the database in the virtual server that I created it in...right? I even see the demo databases whenever I switch to the virtualhosts that I created. Is there a way to keep the databases seperate for each server?

Thanks for any help anyone can give...

PostPosted: 17. October 2004 12:44
by Wiedmann
Hallo,

there is a misunderstanding in your knowledge about MySQL...
MySQL nothing knows about VirtualHosts. With the different entries in phpMyAdmin, you can manage different MySQL-server.

Solution:
Make 3 new databases and 3 new user. Give each user rights on only one of those databases. No global rights. Then, in scripts on vhost1 use user1, scripts on vhost2 use user2 and scripts on vhost3 use user3.

PostPosted: 18. October 2004 20:12
by insomn3ak
ahh, makes more sense now...thanks