The error log file contains information indicating when
mysqld was started and stopped and also any
critical errors that occur while the server is running. If
mysqld notices a table that needs to be
automatically checked or repaired, it writes a message to the
error log.
On some operating systems, the error log contains a stack trace
if mysqld dies. The trace can be used to
determine where mysqld died. See
Section E.1.4, “Using a Stack Trace”.
If mysqld dies unexpectedly and
mysqld_safe needs to restart it,
mysqld_safe writes a restarted
mysqld
message to the error log.
You can specify where mysqld stores the error
log file with the
--log-error[=file_name
]
option. If no file_name
value is
given, mysqld uses the name
host_name
.err
and writes the file in the data directory. If you execute
FLUSH LOGS
, the error log is renamed with the
suffix -old
and mysqld
creates a new empty log file. (No renaming occurs if the
--log-error
option was not given.)
If you do not specify --log-error
, or (on
Windows) if you use the --console
option,
errors are written to stderr
, the standard
error output. Usually this is your terminal.
On Windows, error output is always written to the
.err
file if --console
is
not given.