Mysql logging on CentOS 5.3

for whatever reason when i edited my.cnf on CentSO 5.3 the logging options were never picked up no matter what i tried

gave up messing with my.cnf and put them directly in the init.d file and all was well


make sure that the log files are available and writeable by the mysql user


edit /etc/init.d/mysqld

find the mysqld_safe section and add the --log** sections in as below

# but we need to be sure.
/usr/bin/mysqld_safe   --datadir="$datadir" --socket="$socketfile"
    --log-error="$errlogfile" --pid-file="$mypidfile"
    --user=mysql >/dev/null 2>&1 &


sudo /etc/init.d/mysql restart

and your off logging as normal

note: the general log ( –log=/var/log/mysql.log ) will slow this down

Justin Kelly

Justin Kelly

Web Developer, Business Analytics, Data Engineer specialising in PHP, ReactJS, Tableau, AWS RedShift and Matillion ETL

Based in Melbourne, Australia

Feel free to contact me or _justin_kelly

Leave a comment

Name Notify me of replies by email.