General Query Log

You are viewing an old version of this article. View the current version here.

The general query log is a log of every SQL query received from a client, as well as each client connect and disconnect.

Activating the General Query Log

The general query log is disabled by default. Since it's a record of every query received by the server, it can grow large quite quickly. If you only want a record of queries that change data, rather use the binary log instead.

To activate the general query log, use the --general-log=1 option. The log_output server status variable determines how the output will be written, and can also disable it (see Writing logs into tables for details). If written to file, the name of the file is determined by the --general_log_file=file_name option, by default host_name.log, while the directory will be the data directory unless an absolute path is specified.

Unlike the binary log, the query log records queries in the same order that the server receives them, and not necessarily the same order that they are executed.

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.