0

I'm using MariaDB on my hosting. I would like to limit database size to 1 GB. How to do this properly in /etc/my.cnf ?

2 Answers 2

1

What do you mean by limit? Do you mean that MySQL should just refuse to write anything past the 1GB threshold? This sounds to me like you're just asking for corrupt data.

How can you achieve it? Since there is no option in my.cnf to limit a database size (Again, because this makes no sense), the best solution I can come up with is to place your mysql data directory on its own partition and limit the size of that partition to 1GB.

0

There are two requirements for you to cap the database is 1GB

Once these prerequisites are met, please locate the following in my.cnf:

innodb_data_file_path = ibdata1:10M:autoextend

Just add this to my.cnf

innodb_data_file_path = ibdata1:10M:autoextend:max:1G

and run service mysql restart.

Give it a Try !!!

1
  • This is good but won't work in a shared hosting environment with multiple users :/
    – Spacedust
    Mar 23, 2013 at 15:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .