---
title: "Database maintenance and removing old data"
description: "Database maintenance in OP5 involves purging old data from the MySQL database to reduce its size. Use the mon log purge command with the --remove-older-than option to delete log files and database entries older than a specified time period."
url: "https://docs.itrsgroup.com/docs/faq/op5/4408192223633-op5-monitor-database-maintenance-and-removing-old-data/index.html"
---
## Related to

mysql database maintenance op5 remove old data, removing old data, purge old data, purging old data.

### Problem

- MySQL database on OP5 is large, and the user would like to purge data from it and remove old data.

### Possible Cause(s)

- Standard use of MySQL database.

### Possible Solution(s)

- Use the **mon log purge** command.

  **mon log purge** removes data no longer in use.

  If --remove-older-than is specified, also removes log files and database
  entries older than <difference>. The difference is specified as a number,
  followed by a unit - 'y' for year, 'm' for month, 'w' for week, 'd' for day.
  For instance, to delete all logs older than 1 year:
  mon log purge --remove-older-than=1y

  This also purge the naemon log, so be fore-warned.


