The MySQL Log Files
MySQL has several different log files that can help you find out what’s going on inside mysqld:
|
Log file |
Description |
|---|---|
|
The error log |
Problems encountered when starting, running, or stopping mysqld. |
|
The isam log |
Logs all changes to the ISAM tables. Used only for debugging the isam code. |
|
The query log |
Established connections and executed queries. |
|
The update log |
Deprecated: stores all statements that change data. |
|
The binary log |
Stores all statements that change something. Used also for replication. |
|
The slow log |
Stores all queries that took more than long_query_time to execute or didn’t use indexes. |
All logs can be found in the mysqld data directory. You can force mysqld to reopen the log files (or in some cases switch to a new log) by executing FLUSH LOGS. See Section 4.5.3.
The Error Log
mysqld writes all errors to the stderr, which the
safe_mysqld script redirects to a file called
'hostname'.err. (On Windows, mysqld writes this directly
to \mysql\data\mysql.err.)
This contains information indicating when mysqld was started and stopped and also any critical errors found when running. If mysqld dies unexpectedly and safe_mysqld needs to restart mysqld, safe_mysqld will write a restarted mysqld row in this file. This log also holds a warning if mysqld notices a table that needs to be automatically checked or repaired.
On some operating systems, the error log will contain a stack trace that can be used to find out where mysqld died. See Section D.1.4.
The General ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access