Maintaining Log Files

When the MySQL server starts up, it examines its command-line options to see whether or not it should perform logging and opens the appropriate log files if it should. There are two primary types of logs you can tell the server to generate:

  • The general log file. This reports client connections, queries, and various other miscellaneous events. It is useful for tracking server activity: who is connecting, from where, and what they are doing.

  • The update log. This reports queries that modify the database. The term "update" in this context refers not just to UPDATE statements, but to any statement that modifies a database. For this reason, it contains a record of queries such as DELETE, INSERT, REPLACE, CREATE TABLE, DROP ...

Get MySQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.