MySQL has several different logs that can help you find out what is going on inside mysqld.
|Log Type||Information Written to Log|
|The error log||Problems encountered starting, running, or stopping mysqld|
|The isam log||All changes to the
|The general query log||Established client connections and statements received from clients|
|The update log||All statements that change data (this log is deprecated)|
|The binary log||All statements that change data (also used for replication)|
|The slow query log||All queries that took more than
By default, all log files are created in the
mysqld data directory. You can force
mysqld to close and reopen the log files (or in
some cases switch to a new log) by flushing the logs. Log flushing
occurs when you issue a
LOGS statement or execute a mysqladmin
flush-logs, mysqladmin refresh,
mysqldump --flush-logs, or mysqldump
--master-data command. See Section 126.96.36.199, “
Section 4.5.2, “mysqladmin — Client for Administering a MySQL Server”, and Section 4.5.4, “mysqldump — A Database Backup Program”. In
addition, the binary log is flushed when its size reaches the value
If you are using MySQL replication capabilities, slave replication servers maintain additional log files called relay logs. Chapter 14, Replication, discusses relay log contents and configuration.
See Section 188.8.131.52, “Administrator Guidelines for Password Security”, for information about keeping logs secure.
MySQL Enterprise. The MySQL Enterprise Monitor provides a number of advisors specifically related to the various log files. For more information, see http://www.mysql.com/products/enterprise/advisors.html.