How to change MariaDB error log from syslog to separated log file


On my.cnf, you can see the message like this.

# Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf.


Therefore, if you want to see MariaDB error Log, then you need to check syslog.

For e.g.

$ cat /var/log/syslog | grep "mysql"

$ cat /var/log/syslog | grep "mariadb"


You can change the configuration to edit "/etc/mysql/conf.d/mysqld_safe_syslog.cnf".

$ sudo vi /etc/mysql/conf.d/mysqld_safe_syslog.cnf


[mysqld_safe]

skip_log_error

#syslog


Afterward, input the error log file on my.cnf.

$ vi /etc/mysql/my.cnf

log_error = /var/log/mysql/error.log


Restart MariaDB.


Reference.

https://mariadb.com/kb/en/mariadb/error-log/


+ Recent posts