Saturday, 16 May 2020

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

[MariaDB] 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"


But, you can store error log to a certain file instead of syslog by editing  "/etc/mysql/conf.d/mysqld_safe_syslog.cnf".
$ sudo vi /etc/mysql/conf.d/mysqld_safe_syslog.cnf
[mysqld_safe]
skip_log_error
#syslog

Then, specify the error log file path on my.cnf.
$ vi /etc/mysql/my.cnf
log_error = /var/log/mysql/error.log

Restart MariaDB.
Then error log will be stored into /var/log/mysql/error.log.

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

No comments:

Post a Comment

(KOR)☁️ AWS Solutions Architect Associate 자격증 취득 여정

  !저의 경험 , 팁 , 그리고 SAA-C03 자격증 합격을 위한 노하우 공유! 조금 늦은 포스팅이지만 , 꼭 공유하고 싶었던 이야기입니다 . 회사 내 주변 동료들이 자주 이렇게 말하곤 했습니다 . “ 님 실...