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
query log
binary log
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
Command line
There are no comments on this page. [Add comment]