MariaDB - Error log configuration?
I have MariaDB on my Debian 7 and would like to know why mysql suddenly stops. I have to edit my.cnf
and define the path to the error log file.
According to this , I have to put log-error = /path/to/error/log
under [mysqld_safe]
and [mysqld]
.
But according to this I have to put log_error = /path/to/error/log
under [mysqld]
.
So which is the correct way? log-error
or log_error
?
source to share
log-error or log_error
log-error
- correct name to assign when setting parameters in the options file my.cnf
.
log_error
is the correct system variable name when read as 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 enough to place it in either 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
source to share
-
Your variable
log_error
, but you are defininglog-error;
all variables with "_" and not with "-". It hit me in the head a while ago. When I do it with helplog_error
, it starts up correctly. -
After you fix "-" to "_", you must enter
/etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf
and comment out 2 lines:-
skip_log_error
-
syslog -> #skip_log_error #syslog
Otherwise, errors will go to syslog and you will wonder where they are. These files should only be used when the mysqld_safe option is used when starting mysqld, but in fact they are also used when you start normally. In mariadb 10.1. * These 2 lines are deleted.
-
source to share