How to Fix “Duplicate Log Entry for /var/lib/mysql/mysqld.log” Error in Logrotate

June 17, 2025 / cPanel & WHM

This guide explains how to fix the “Duplicate Log Entry for /var/lib/mysql/mysqld.log” error that appears when logrotate runs through cron. The error occurs because both /etc/logrotate.d/mysql and /etc/logrotate.d/mysqld contains log rotation rules for the same log file, causing a conflict.

To resolve the issue, follow the steps:

  1. Check for conflicting logrotate entries:
    ls -lsa /etc/logrotate.d/mysql*

    You will see both:

    /etc/logrotate.d/mysql
    /etc/logrotate.d/mysqld
  2. Remove the conflicting mysql entry:
    rm /etc/logrotate.d/mysql

    Ensure that mysqld is handling log rotation correctly before removing any file.

  3. Verify:
    Run logrotate manually to confirm the error is resolved:

    logrotate -f /etc/logrotate.conf

This error is caused by duplicate log rotation rules for the same MySQL log file. Removing the redundant mysql config resolves the issue and ensures smooth log rotation. Need a hand? Our support team is here to help!

Managing server settings further? Learn How to copy locales using WHM

Spread the love