Get the default configuration file mysqld for MySQL, optimized for CentOS Linux 6. This example configuration ensures optimal compatibility and performance for MySQL, making it easy to set up and adjust to meet your needs.
Find and download the configuration file here: /etc/logrotate.d/mysqld.
For more configurations and setup guides, visit our related files section to further customize your system.
# This logname can be set in /etc/my.cnf
# by setting the variable "err-log"
# in the [safe_mysqld] section as follows:
#
# [safe_mysqld]
# err-log=/var/log/mysqld.log
#
# If the root user has a password you have to create a
# /root/.my.cnf configuration file with the following
# content:
#
# [mysqladmin]
# password = <secret>
# user= root
#
# where "<secret>" is the password.
#
# ATTENTION: This /root/.my.cnf should be readable ONLY
# for root !
# Then, un-comment the following lines to enable rotation of mysql's log file:
#/var/log/mysqld.log {
# create 640 mysql mysql
# notifempty
# daily
# rotate 3
# 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
#}
Download the raw file with wget or curl
wget -O mysqld.example https://exampleconfig.com/static/raw/mysql/centos6/etc/logrotate.d/mysqld
curl https://exampleconfig.com/static/raw/mysql/centos6/etc/logrotate.d/mysqld > mysqld.example
Other config files you might find useful