mySQL user databases

5 posts / 0 new
Last post
#1 Thu, 07/12/2007 - 11:52
mike

mySQL user databases

ok i have 2 questions, first one is... when i have everything running properly, user accounts set to the home directory, sql databases in /var/lib/mysql etc. etc. and a user decides he/she would like a forum and creates it, does the size of the database effect the users quota usage? i would like to set "/home" on its own HDD with quotas enabled, the second question is, i have created 1 test account to see how things layout and all that stuff and i noticed that virtualmin created 1 user database for that account, is the automatic creation of this database required or can i just go in and disable it?

Thu, 07/12/2007 - 19:21
Joe
Joe's picture

Hey Mike,

MySQL databases (but not PostgreSQL) are included in quotas, but I believe only if they are on the same partition (quotas never span partitions). Virtualmin can also perform advisory quota checks, which can pull data regardless of the partition, but this isn't as nice as using system quotas. The system knows more than Virtualmin about disk usage and it knows it in real time, whereas Virtualmin has to check periodically via a time-consuming process.

Automatic creation of databases is not required--Webmin and Virtualmin are wholly independent of everything that they manage (and even when we use a database, we use a Berkeley DB or an SQLite, which is embedded and difficult to break). A large percentage of Install Scripts need a database, though.

--

Check out the forum guidelines!

Thu, 07/12/2007 - 23:26 (Reply to #2)
Joe
Joe's picture

Hey Mike,

Moving databases to /home isn't a problem, but putting them within /home/domain almost certainly is. I'm not sure, off-hand, how MySQL handles group membership, but it's probably not safe to make use of secondary groups like we do with Apache.

But, once they were in /home, quotas would apply fine, so it would solve the problem that you've set out to solve...I don't think they'd have to actually be in the /home/domain directory.

We'd have to do some research to see if we could treat MySQL like we treat Apache, and give it group membership in the domain group...that would allow it to traverse into the domain home.

--

Check out the forum guidelines!

Thu, 07/12/2007 - 22:27
mike

ok, thenk you for your information, i now have another couple questions being the default install of mySQL makes the database directory "/var/lib/mysql/" how hard would it to set the directory to be independant of the user like say "/home/*/sql/" or would doing such a thing break the sql system durring updates? also how would i go about disabling the automatic sql database creation while keeping mySQL enabled for new accounts?

Fri, 07/13/2007 - 06:32
mike

all right, in simple terms if I place a folder in the home directory and call it "sql" or something of an equivalent that would tell me the contents just by looking at it, then it would work just as good as using the default? would i then have to exchange the default directory "/var/lib/mysql/" with a simlink to the new location for the sake of future mysql updates?

Topic locked