One, log-related server variables
Mysql>show Global variables like '%log% '
+-----------------------------+----------------------------------------+
| variable_name | Value |
+-----------------------------+----------------------------------------+
| Back_log | 50 |
| Binlog_cache_size | 32768 |
| Binlog_direct_non_transactional_updates | OFF |
| Binlog_format | STATEMENT |
| Expire_logs_days | 0 |
| General_log | OFF |
| General_log_file | /root/mysql/run/mysqld/mysqld.log |
| Innodb_flush_log_at_trx_commit | 1 |
| Innodb_locks_unsafe_for_binlog | OFF |
| Innodb_log_buffer_size | 1048576 |
| Innodb_log_file_size | 5242880 |
| Innodb_log_files_in_group | 2 |
| Innodb_log_group_home_dir |./|
| innodb_mirrored_log_groups | 1 |
| Log | OFF |
| Log_bin | OFF |
| log_bin_trust_function_creators | OFF |
| log_bin_trust_routine_creators | OFF |
| Log_error | /root/mysql/log/mysqld.log |
| Log_output | FILE |
| log_queries_not_using_indexes | OFF |
| Log_slave_updates | OFF |
| log_slow_queries | OFF |
| log_warnings | 1 |
| Max_binlog_cache_size | 18446744073709547520 |
| Max_binlog_size | 1073741824 |
| Max_relay_log_size | 0 |
| Relay_log | |
| Relay_log_index | |
| Relay_log_info_file | Relay-log.info |
| Relay_log_purge | On |
| Relay_log_space_limit | 0 |
| Slow_query_log | OFF |
| Slow_query_log_file | /root/mysql/run/mysqld/mysqld-slow.log |
| Sql_log_bin | On |
| Sql_log_off | OFF |
| Sql_log_update | On |
| Sync_binlog | 0 |
+--------------------------+----------------------------------------+
Second, the type of log:
1. Query log:
(1), the query operation generated during the system query, the default is closed.
(2), the relevant server parameters:
Log
Log_output
General_log
General_log_file
2, slow query log: Query execution time longer than the specified length of the query, that is, slow query.
3. Error log:
4. Binary log: MySQL's replication feature relies on this log.
5. Relay LOG: Logs that are read and saved from the server from the primary server.
6. Transaction log:
MySQL Advanced four--mysql log