(1) ERRLOG contains information related to mysqd startup and shutdown, and any serious errors occurring on the server during running; you can use the-log-error [file_name] option to specify the location where mysqld saves the error log file. If the file_name value is not specified,
(1) ERRLOG
It contains the related information when mysqd is started and stopped, and when the server encounters any serious error during running;
You can use the-log-error [= file_name] option to specify the location where mysqld saves the error log file. If the file_name value is not specified, mysqld uses the error log name host_name.err and writes the log file to the data directory;
# * Logging and Replication# Both location gets rotated by the cronjob.# Be aware that this log type is a performance killer.# As of 5.1 you can enable the log at runtime!# general_log_file = /var/log/mysql/mysql.log fg# general_log = 1# Error log - should be very few entries.log_error = /var/log/mysql/error.log
(2)BINLOG
Binary logs contain all updated data or potentially updated data (for example, no matching
All statements of a row's DELETE. The statement is saved as an "event" and describes data changes;
root@kallen:/# mysqlbinlog log-file /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; mysqlbinlog: File 'log-file' not found (Errcode: 2) DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; ddkosooodfdsfsfs/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; root@kallen:/#
(3) slow query logs
Records all log files containing SQL statements whose execution time exceeds long_query_time. Obtaining the initial lock time is not counted as the execution time.
Use the-log-slow-queries [= file_name] option to start it. If the file_name value is not given, the default host name and suffix is-slow. log. If the file name is provided but not the absolute path name, the file is written to the data directory.
root@kallen:/var/log/mysql# mysqldumpslow log-file
root@kallen:~# mysqldumpslow /var/log/mysql/mysql-slow.log Reading mysql slow query log from /var/log/mysql/mysql-slow.log Count: 1 Time=0.88s (0s) Lock=0.00s (0s) Rows=0.0 (0), debian-sys-maint[debian-sys-maint]@localhost select count(*) into @discard from `information_schema`.`COLUMNS` Count: 1 Time=0.16s (0s) Lock=0.00s (0s) Rows=35.0 (35), debian-sys-maint[debian-sys-maint]@localhost select concat('S', TABLE_SCHEMA, 'S', TABLE_NAME, 'S') from information_schema.TABLES where ENGINE='S' root@kallen:~#