O'Reilly logo

MySQL 8 Cookbook by Karthik Appigatla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

General query log

As per the MySQL documentation:

The general query log is a general record of what mysqld is doing. The server writes information to this log when clients connect or disconnect, and it logs each SQL statement received from clients. The general query log can be very useful when you suspect an error in a client and want to know exactly what the client sent to mysqld:

  1. Specify the file for logging. If you do not specify, it will be created in the data directory with the name hostname.log. The server creates the file in the data directory unless an absolute path name is given to specify a different directory:
mysql> SET @@GLOBAL.general_log_file='/var/log/mysql/general_query_log';Query OK, 0 rows affected (0.04 sec)
  1. Enable ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required