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
?
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
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
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With