I'll have the same problem, too, in some months...
What I was thinking about is to create a cron job that runs say every hour and calculates
each user's database size. Comparing it with a stored per-user value, the script (running
as kind of a mysql superuser) REVOKEs or re-GRANTs UPDATE and INSERT rights to the user on
this database. So he can still DELETE his data to some smaller size but can't INSERT any
This leaves a gap of about an hour to the user, where he can go over quota, but that's
all. Maybe one could automate this script that is sends a warning to the sysadmin when a
database is over-quota for more than 2 days or so. Maybe it can also send a warning to
the user immediately...
I don't know yet in what language to write this script. I thought of PHP because I already
have the required code snippets there, but using PHP for system scripts doesn't seem to
work really good. Guess I'll have to learn some Perl for that...
If anyone already has such a script of is going to write one, I'd be thankful for a copy
of it :)
Von: "LaCraze" <lacraze@stripped>
Gesendet: Montag, 21. Juli 2003 06:22
> I am a Redhat user. Presently using RH 7.3 and mysql 3.23. I am doing some
> web hosting services. I have system quota installled and enable. Is there a
> way, to tell mysql to have individual databases in my user's directories
> instead of /var/lib/mysql/ ?
> For example user1 has a web space in /home/hostings/user1 and his database
> in /home/hostings/user1/data and user2 will have his web space in
> /home/hostings/user2 and database in /home/hostings/user2/data
> I need to be able to do this as we are renting out disk space. There are
> some customers who have their web space quota within the limited but
> exceeded in mysql and we are loosing alot of bandwidth too, thus loosing
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=1