How to View MariaDB Logs
To view the logs of the MariaDB database, you can use one of the following methods:
1. Utilize command line tools: Login to the MariaDB database through the command line, and then use the following command to view the logs:
SHOW LOGS;
This will list the available log files. Next, use the following command to view the contents of a specific log file (e.g. the error log file):
SHOW ERRORS;
Viewing log files: MariaDB stores log files in a specific directory, with the exact location varying depending on the operating system. Common locations include:
- The directory /var/log/mysql/ or /var/log/mariadb/ on Linux.
- The directory for data in C:\Program Files\MariaDB\MariaDB
\data on Windows
In this directory, you can find the following common log files:
- Error log file, usually named as error.log or
.err. - The log file used for querying, typically named query.log or
.log. - Binary log files are typically named as binlog followed by a sequence number.
Open the log file with a text editor to view its contents.
Please note that viewing log files may require administrative privileges.