Home > Archive > MySQL Server Forum > August 2005 > disk quota in MySQL









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author disk quota in MySQL
Rajesh Kapur

2005-08-23, 1:23 pm

Hello,

Is there a way to assign a limit on the size of a specific database? For
example database A can take up no more than 500 MB.
One of my databases can potentially grow without any bounds and possibly
stop other critical databases from operating.
We are using MySQL 4.0.21 on Linux. We use innodb tables.

Thanks!
- Rajesh


Bill Karwin

2005-08-25, 8:23 pm

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.
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com