1

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.

Gruber
  • 151
  • 3
  • 9

1 Answers1

3

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.

daemonofchaos
  • 1,211
  • 1
  • 8
  • 10
  • Thanks. Do you know if binary logging is enabled by default? [The docs](http://dev.mysql.com/doc/refman/5.0/en/server-logs.html) 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. – daemonofchaos 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. – daemonofchaos Sep 28 '12 at 13:05