mariadberror-logmy.cnf

MariaDB error log


I have mariadb 10.0.23 on debian jessie. I want to check mysql's error log and so I added this line to my.cnf:

log-error = /var/log/mysql/error.log

and then I restarted the service mysql:

service mysql restart

After that, I checked the path /var/log/mysql/ but there wasn't any error.log over there.

In addition I checked the system variable log_error:

mysql> show variables like '%error%';

and I saw that the value of the variable log_error is blank :(

Can anybody help me to solve this problem?


Solution

    1. Your variable is log_error, but you define log-error; all variables are with "_", not with "-". It had hit my head some time ago too.
    2. After you do correct it, you must enter /etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf and comment the 2 lines: skip_log_error and syslog -> #skip_log_error and #syslog. Otherwise errors will go to the syslog and you will wonder where are they. This file should been used only when there is mysqld_safe option used when starting mysqld, but in fact they are also used when you start normally.