A duplicate log entry error means logrotate has more than one rule covering the same file. Identify the overlapping MySQL rules and keep one suitable rotation policy instead of deleting a configuration file without checking it.
Locate the duplicate rules
With administrative access, run a debug check:
sudo logrotate --debug /etc/logrotate.confThis prints the configuration and decisions without rotating logs. Inspect the files named in the error, including any wildcard patterns that also match /var/lib/mysql/mysqld.log.
Names such as /etc/logrotate.d/mysql and /etc/logrotate.d/mysqld vary between packages, so do not assume both exist or that one is redundant.
Consolidate the configuration
- Back up the affected configuration files outside /etc/logrotate.d/.
- Check which package or service owns each rule.
- Retain one complete policy for the log, including any required ownership, permissions and post-rotation command.
- Remove the duplicate stanza or narrow the overlapping pattern. If a whole file is obsolete, move it out of the included configuration directory rather than deleting it immediately.
- Run the debug check again and confirm the duplicate error has gone.
Avoid –force as a configuration test: it can rotate and remove logs according to the configured retention policy. Check the next scheduled run and confirm MySQL continues writing to the expected log.