Maintenance of the server logs

All server logs require some maintenance. We will start with the FLUSH statements, which can be used occasionally, to ensure that the last information is written to the files. Then, we will discuss how to rotate both the file- and table-based logs to the free space available on the disk.

Flushing logs

After performing certain operations, or before performing a backup, you may want to flush the contents in the logs. Flushing a log means that its files are closed and reopened, and all the buffered information is written to the file during the process. For file-based logs, the FLUSH LOGS statement can be used. To flush all logs, simply run the following command:

FLUSH LOGS;

The following flavors are available to selectively ...

Get Mastering MariaDB now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.