Since MySql does not have a built in quota tool, I wonder how the Big Companies like Daddy and Gator and so on manage their limitations for users?
I was thinking about to use some kind of script to check if the db is over a certain size, but if someone imports a huge thing in, then what? Is there a limitations for how big dump can be imported in?
Best Answer
Usually it's one of two methods:
1) Limit the disk space using a filesystem quota for the folder where the database file is hosted. This is easily accomplished using
/home
directories for each user and symbolic links to where MySQL looks for the database files.2) A cron script runs every x minutes that checks for table sizes and revokes CREATE/INSERT statements for databases over the limit.
The second method won't prevent short-term abuse, but you can minimize impact by ensuring there's plenty of extra space and have policies in place to discourage abuse.