Bug #73949 | mysql's error-log name in logrotate script is wrong | ||
---|---|---|---|
Submitted: | 17 Sep 2014 11:58 | Modified: | 15 Dec 2016 12:56 |
Reporter: | Shahriyar Rzayev | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Installing | Severity: | S1 (Critical) |
Version: | 5.6.20 | OS: | Linux (CentOS 6.5) |
Assigned to: | CPU Architecture: | Any |
[17 Sep 2014 11:58]
Shahriyar Rzayev
[18 Sep 2014 0:43]
MySQL Verification Team
Thank you for the bug report. Quoting you: 2. Official documentation states that: "Default log file name will be hostname.err and will reside in datadirectory if not specified explicitly". The above means IF NOT SPECIFIED EXPLICITLY. but on Centos 6.5: [root@tikal miguel]# cat /etc/my.cnf | grep mysqld.log log-error=/var/log/mysqld.log So the log-error file is specified explicitly as mysqld.log and testing removing it from my.cnf commentin it: [root@tikal miguel]# cat /etc/my.cnf | grep mysqld.log #log-error=/var/log/mysqld.log stop the server and start it and now the log-error file is hostname.err: [root@tikal miguel]# service mysqld start Starting mysqld: [ OK ] [root@tikal miguel]# cat /var/lib/mysql/tikal.br.err 140917 21:32:00 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 2014-09-17 21:32:01 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2014-09-17 21:32:01 5320 [Note] Plugin 'FEDERATED' is disabled. 2014-09-17 21:32:01 5320 [Note] InnoDB: Using atomics to ref count buffer pool pages 2014-09-17 21:32:01 5320 [Note] InnoDB: The InnoDB memory heap is disabled 2014-09-17 21:32:01 5320 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2014-09-17 21:32:01 5320 [Note] InnoDB: Memory barrier is not used 2014-09-17 21:32:01 5320 [Note] InnoDB: Compressed tables use zlib 1.2.3 <CUT>
[18 Sep 2014 7:26]
Shahriyar Rzayev
The purpose of report is that, Error log name is wrong in /etc/logrotate.d/mysql script which is installed by default after fresh install. In any conditions there will be no such error log name as "/var/lib/mysql/mysqld.log" As you stated it will be "/var/log/mysqld.log" file after fresh install. But if you comment it you will have an error log file named as hostname.err and it will reside in datadir, again as you specified: "/var/lib/mysql/tikal.br.err" So again as i show, the default installed and created rule for logrotation is wrong. Exactly the name of error log file: /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 } The second issue is about, using mysqladmin in logrotate script without password it will surely raise an error because there is no such server without root password :) So the script named in source tree "/mysql-5.6.20/support-files/mysql-log-rotate.sh" is problematic.
[18 Sep 2014 12:25]
MySQL Verification Team
Indeed thank you for the feedback. Now changing status.
[15 Dec 2016 12:56]
Erlend Dahl
Fixed in 5.7.18, 8.0.1 under the heading of Bug#22322685 ERROR LOG DEFINED PATH MIS-ALIGNS WITH LOGROTATE.D CONFIG IN RPM INSTALL