CentOS 5.5 MySQL 5.5 installed via a yum repository
[ERROR] Could not use /var/log/mysqld.slow.log for logging (error 13). Turning logging off for the whole duration of the MySQL server process. To turn it on again: fix the cause, shutdown the MySQL server and restart it.
Using a standard install of MySQL 5.5 (specifically from the webtatic repository), the slow query log cannot start actually recording due to a permissions issue. If I pre-create a copy and chown
it to belong to user:mysql and group:mysql, then it works fine.
In the very same directory (/var/log
), it has no problems creating and logging to mysql.log and mysql.error.log.
Obviously I have a hackish fix for it, but I'd like to be able to use logrotate on it, without additionally requiring logrotate to repeat the hackery too. (The only thing worse than hackery is having to repeat hackery.)
Does anyone know what the best practice is for fixing this?