Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MariaDB - Error log configuration?

I have MariaDB in my Debian 7 and would like to know why mysql suddenly stop. I should edit my.cnf and define the path of error log file.

According to this I should put log-error = /path/to/error/log under [mysqld_safe] and [mysqld].

But according to this I should put log_error = /path/to/error/log under [mysqld].

So, which is the correct way? log-error or log_error ?

like image 402
user3195859 Avatar asked Oct 20 '14 17:10

user3195859


2 Answers

log-error or log_error

log-error is the correct name to assign to when setting options in the options file my.cnf.

log_error is the correct system variable name when reading like SHOW VARIABLES LIKE '%error%'.

https://mariadb.com/kb/en/mariadb/documentation/optimization-and-tuning/system-variables/server-system-variables/#log https://dev.mysql.com/doc/refman/5.7/en/mysqld-option-tables.html

[mysqld_safe] or [mysqld]

It is sufficient to put it in any one of the two sections, [mysqld_safe] or [mysqld]. MariaDB and MySQL read both sections.

https://mariadb.com/kb/en/mariadb/documentation/getting-started/starting-and-stopping-mariadb/mysqld_safe/ https://dev.mysql.com/doc/refman/5.7/en/mysqld-safe.html

like image 75
Julian Ladisch Avatar answered Sep 29 '22 23:09

Julian Ladisch


  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. When I make it with log_error it starts correctly.

  2. After you do correct the "-" to "_" , you must enter /etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf and comment the 2 lines:

    • skip_log_error
    • syslog -> #skip_log_error #syslog

    Otherwise errors will go to the syslog and you will wonder where they are. 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. In mariadb 10.1.* these 2 lines are removed.

like image 22
mysql niewbie Avatar answered Sep 30 '22 01:09

mysql niewbie