一般查询日志

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

一般查询日志是用户记录从客户端收到所有 SQL 查询,同时也包括了每一个客户端的链接和断开链接。

启用一般查询日志

在默认情况下一般查询日志是被系统禁用的。因为这个日志用于记录服务器收到的所有 SQL 查询,这会导致这个文件膨胀得非常快。

如果你值希望查看修改数据的 SQL 查询,你可以使用binary log来替代一般查询日志。

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. 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.