Rajesh Kapur wrote:
Is there a way to assign a limit on the size of a specific database?
This question comes up on this newgroup from time to time.
I've searched for a solution, but there are no satisfactory ones.
Some solutions involve having a scheduled job detect when a database has
exceeded the authorized space, and then raise it to the attention of the
system administrator.
Some solutions involve trying to use the operating system's quota
enforcement (where available), but this solution is complex and usually
insufficient, because MySQL databases are generally all owned by one
user id, and stored under one directory. So unless the quota
enforcement can be made per-directory or per-file, it's hard to use this
way. Also, InnoDB tables are all stored together in one physical file,
regardless of how many databases they belong to.
Some solutions involve putting the database files on separate
filesystems, and symbolically link them into MySQL's data directory.
When the filesystem fills up, further writes get fatal errors. But this
is not a very good strategy for graceful error handling.
MySQL has no built-in property to define and enforce a limit to the size
or number of records in a database or table. At least, not that I've found.
Regards,
Bill K.