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:

  1. The directory /var/log/mysql/ or /var/log/mariadb/ on Linux.
  2. The directory for data in C:\Program Files\MariaDB\MariaDB\data on Windows

In this directory, you can find the following common log files:

  1. Error log file, usually named as error.log or .err.
  2. The log file used for querying, typically named query.log or .log.
  3. 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.

bannerAds