Bug #78512 /var/log/mysqld.log has incorrect permissions after installing server from repo
Submitted: 22 Sep 2015 8:49 Modified: 20 May 2016 14:41
Reporter: Ramana Yeruva Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Packaging Severity:S3 (Non-critical)
Version:5.7.9 OS:Any
Assigned to: CPU Architecture:Any

[22 Sep 2015 8:49] Ramana Yeruva
This issue doesn't effect any default installation of repo rpms if user uses init scripts that are shipped as part of package but will have trouble if user tries to createdb or start server manually.
after installing mysql-server from repository(yum,zypper) /var/log/mysqld.log is created with logged in user and group permissions instead of with mysql user and group permissions,due to which while creating database or starting server, it is failing

How to repeat:
yum -y remove 'mysql*'
rm -rf /var/log/mysqld.log /var/lib/mysql
yum -y install mysql-community-release-el5-11.noarch.rpm
yum -y --enablerepo=mysql57-community-dmr install mysql-server
[lroot@viking77 Ramana]# ls -ld /var/lib/mysql
drwxr-x--x 2 mysql mysql 4096 Sep 15 10:39 /var/lib/mysql
[lroot@viking77 Ramana]# ls -ld /var/log/mysqld.log 
-rw-r--r-- 1 root lroot 0 Sep 22 10:18 /var/log/mysqld.log
[lroot@viking77 Ramana]# mysqld -umysql --basedir=/usr/ --datadir=/var/lib/mysql --initialize<--try creating database or start server, failing without any reason,but obvious reason is due to log file permissions problem
[lroot@viking77 Ramana]# ls -lrt /var/log/mysqld.log 
-rw-r--r-- 1 root lroot 0 Sep 22 10:18 /var/log/mysqld.log
[lroot@viking77 Ramana]# ls -lrt /var/lib/mysql
total 0

Suggested fix:
generate /var/log/mysqld.log with correct permissions while installing server packages from repo
[20 May 2016 14:41] Paul DuBois
Posted by developer:
Noted in 5.5.51, 5.6.32, 5.7.13 changelogs.

Installing MySQL from a yum or zypper repository resulted in
/var/log/mysqld.log being created with incorrect user and group