MySql log files
Global Settings
May be globally defined in /etc/mysql/my.cnf# * Logging and Replication # # Both location gets rotated by the cronjob. # Be aware that this log type is a performance killer. log = /var/log/mysql.log #log = /var/log/mysql/mysql.log # # Error logging goes to syslog. This is a Debian improvement :) # # Here you can see queries with especially long duration #log-slow-queries = /var/log/mysql/mysql-slow.log # # The following can be used as easy to replay backup logs or for replication. #server-id = 1 log-bin = /var/log/mysql/mysql-bin.log expire-logs-days = 20 max_binlog_size = 104857600 #binlog-do-db = include_database_name #binlog-ignore-db = include_database_name
error log
--log-error[=file_name]
query log
--log[=file_name]
binary log
--log-bin[=base_name]
slow query log
--log-slow-queries[=file_name]
WARNING
Error logs and Query logs are overwritten when you restart mysqld or flush the logs. So make sure you save them FIRST !Save logs
$ cd mysql-logfile-directory $ cp mysql.log mysql.old $ cp mysql-slow.log mysql-slow.old
then restart mysql or flush logs
SQL statement
> flush logs
Command line
$ mysqladmin flush-logs