On Tuesday, January 13, 2004 11:52 PM CET, Anders Norrbring wrote: > Hiya all! > > I'm curious about if there's a simple way to manage user quotas in a > MySQL database? F.x. user one can have 10MB data in the database and > user two can have a maximum of 5MB? > > Anders Norrbring
AFAIK MySQL has no support for this. But as I also need to implement such a thing in some time, too, I've heard of an interesting approach some time ago: You need to periodically check the users' databases and calculate their sizes. If one exceeds its quota, which you will have to check against your own table, just revoke any insert/update/aso. rights from this user. So then, he can only delete data from the table to make it smaller. If the size is in quota again, you simply grant the rights 'back'. This is not an exact implementation of quota, and if you only check the databases hourly, one will be able to massively exceed the quota within this time, but if someone really does this, you can still kick him forever afterwards ;) Maybe you could also count the filesize of the database directories? Just a thought. I'm planning to write either a PHP or a C program for this, maybe I'll post it here, when it's finished... -- Yves Goergen [EMAIL PROTECTED] Please don't CC me (causes double mails) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]