Ubuntu 20.04 (Focal Fossa)
# dpkg -l | grep mariadb-server-10
ii mariadb-server-10.3 1:10.3.38-0ubuntu0.20.04.1 amd64 MariaDB database server binaries
# grep -E 'skip_log_error|syslog|log_error' /etc/mysql/ -R | grep -v '#'
/etc/mysql/mariadb.conf.d/50-server.cnf:log_error = /var/log/mysql/error.log
/etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf:skip_log_error
/etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf:syslog
# tail -2 /var/log/mysql/error.log
2023-07-28 8:30:23 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.3.38-MariaDB-0ubuntu0.20.04.1' socket: '/run/mysqld/mysqld.sock' port: 3306 Ubuntu 20.04
Ubuntu 22.04 (Jammy Jellyfish)
# dpkg -l | grep mariadb-server-10
ii mariadb-server-10.6 1:10.6.12-0ubuntu0.22.04.1
# grep -E 'skip_log_error|syslog|log_error' /etc/mysql/ -R | grep -v '#'
/etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf:skip_log_error
/etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf:syslog
# tail -2 /var/log/mysql/error.log
tail: cannot open '/var/log/mysql/error.log' for reading: No such file or directory
Up until Ubuntu 22.04, the MariaDB log was written to /var/log/mysql/error.log
. Since the log_error
system variable has apparently been removed in Ubuntu 22.04 from /etc/mysql/mariadb.conf.d/50-server.cnf
, this isn't the case anymore.
- Why was
log_error
removed from the configuration file /etc/mysql/mariadb.conf.d/50-server.cnf
?
- Why was the log file
/var/log/mysql/error.log
still created in Ubuntu 20.04, even though skip_log_error
was used by default?
- I assume this is due to the order in which the configuration files are processed, if so, where can I see this?
Side note
The log file did not exist before MariaDB was installed.
# ls /var/log/mysql/error.log
ls: cannot access '/var/log/mysql/error.log': No such file or directory
# dpkg -l | grep mariadb-server-10
# apt install mariadb-server
(...)
# dpkg -l | grep mariadb-server-10
ii mariadb-server-10.3 1:10.3.38-0ubuntu0.20.04.1 amd64 MariaDB database server binaries
# ls /var/log/mysql/error.log
/var/log/mysql/error.log