2 Virtual Servers sharing the same mysql DB. how2?

5 posts / 0 new
Last post
#1 Sun, 01/27/2008 - 01:33
mikep

2 Virtual Servers sharing the same mysql DB. how2?

Hi, Just starting to use virtualmin with my new web host and getting used to its concepts...

I have one virtual server (www.mydomain1.com) which has a mysql database.

I now want to serve another domain (www.mydomain2.com) - i believe i do this by creating a new virtual server through virtualmin.

however, i want that second domain to SHARE the same mysql db as the first one (the second one reports on it in a read-only mode)

my question is: how would i set this up? i've tried the "sub-server" option but don't seem to be able to see the existing db from my new virtual server.

thanks in advance for any help offered! Mike

Sun, 01/27/2008 - 10:23
RickBeall

<br><br>Post edited by: RickBeall, at: 2008/01/27 10:24

Mon, 01/28/2008 - 09:53 (Reply to #2)
mikep

thanks for the help Rick! yeah turns out the db can be seen fine from the new virtual server when i access it in code, it just looked from within virtualmin that it couldn't be seen.

Thanks again!
Mike

Mon, 01/28/2008 - 12:44 (Reply to #3)
Joe
Joe's picture

Hey guys,

I'll add a couple of comments...

Virtualmin has a model of one user per database (but each user can have multiples, if the admin allows it). This is to keep things simple and comprehensible in the UI. But, like many things in Virtualmin, the rabbit hole goes much deeper by dropping down to the Webmin layer. In the Webmin MySQL module, you can grant any number of users any kind of access to any number of databases. These relations won't show up in Virtualmin, but the MySQL module is pretty easy to use, if you know enough to know you need multiple users to have access to a database. We use this feature regularly on virtualmin.com. When I migrated users from OACS to Joomla, I granted only SELECT privs, and our license manager has a dedicated user that only has SELECT on two tables and write privs on another. It's sensible, but can be quite intimidating for users who just want to run a forum or something.

--

Check out the forum guidelines!

Sun, 01/27/2008 - 10:23
RickBeall

You might want to just try accessing the one from the other. In the past, in other software, I've noticed that nothing stops one db from being shared with all domains hosted on that physical server. I don't know if this is trure of Virtualmin though.

Topic locked