I used to manage Microsoft SQL Server installations. Now I'm up against a MySQL 5.1 server.

On MSSQL, I remember databases have transaction log files which grow larger and larger as transactions occur. If you don't truncate the files every now and then, you will eventually run out of disk space. So even if you compact your databases by deleting old rows, disk space will be running out.

I wonder if MySQL behaves similarly and what steps I need to take to make sure that disk space won't get depleted.


The same is true with MySQL (and any database server with logging) when you have binary logging enabled.

Check out the MySQL documentation regarding binary logging as it points out a number of variables that effect the size of the logs and how often they get rotated.

In addition the section on Log Maintenance will also be important to you.

  • Thanks. Do you know if binary logging is enabled by default? The docs appear to say all logging is off. – Gruber Sep 28 '12 at 13:01
  • 1
    I have found that whether binary logging is enabled by default is dependent upon every installation. If you have access to the mysql configuration file (usually /etc/my.cnf or /etc/mysql/mysql.cnf) you can grep for log-bin for it's value. – Daemon of Chaos Sep 28 '12 at 13:04
  • 1
    If you don't have access to the configuration file you could issue the command SHOW VARIABLES LIKE 'log_bin'; in the mysql client. – Daemon of Chaos Sep 28 '12 at 13:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.