Bug #85316 The log file of mysql don't rotate by default
Submitted: 6 Mar 2017 6:26 Modified: 6 Mar 2017 9:22
Reporter: Jingli Feng Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Packaging Severity:S3 (Non-critical)
Version:5.7.17 OS:Linux (SLES11)
Assigned to: CPU Architecture:Any
Tags: log, logrotate

[6 Mar 2017 6:26] Jingli Feng
Description:
I have download V839935-01.zip to install mysql on SLES11 SP3.
Server version: 5.7.17-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)

In /etc/my.cnf, the value of log-error parameter is /var/log/mysql/mysqld.log,
but the file configured in /etc/logrotate.d/mysql is  /var/lib/mysql/mysqld.log.

SLES11-3:/opt/mysql # grep -i log-error /etc/my.cnf
log-error=/var/log/mysql/mysqld.log
SLES11-3:/opt/mysql # grep -v "^#" /etc/logrotate.d/mysql

/var/lib/mysql/mysqld.log {
        create 600 mysql mysql
        notifempty
        daily
        rotate 5
        missingok
        compress
    postrotate
        # just if mysqld is really running
        if test -x /usr/bin/mysqladmin && \
           /usr/bin/mysqladmin ping &>/dev/null
        then
           /usr/bin/mysqladmin flush-logs
        fi
    endscript
}
SLES11-3:/opt/mysql #

So, the log file can't be rotated by default. I think this is a problem.

How to repeat:
look at the content of file /etc/my.cnf and /etc/logrotate.d/mysql

Suggested fix:
The value of log-error parameter in /etc/my.cnf and the file configured in /etc/logrotate.d/mysql shoud be same after installing MySQL by default.
[6 Mar 2017 7:51] Umesh Shastry
Hello Jingli Feng,

Thank you for the report and feedback!

Thanks,
Umesh
[6 Mar 2017 9:22] Terje Røsten
Noted in 5.7.18, 8.0.1 changelogs.

For RPM packages, the default error-log location in the deployed
/etc/my.cnf file differed from the location in the installed
logrotate script, causing logrotate to fail.
[6 Mar 2017 9:24] Terje Røsten
See also: https://bugs.mysql.com/bug.php?id=73949