1. View MySQL Log
Mysql> show global variables like '%log% '; +-----------------------------------------+-------------------------+| variable_name | Value |+-----------------------------------------+-------------------------+| Back_log | 80 | | Binlog_cache_size | 32768 | | Binlog_checksum | CRC32 | | Binlog_direct_non_transactional_updates | OFF | | binlog_error_action | Ignore_error | | Binlog_format | STATEMENT | | Binlog_gtid_simple_recovery | OFF | | Binlog_max_flush_queue_time | 0 | | Binlog_order_commits | On | | Binlog_row_image | Full | | binlog_rows_query_log_events | OFF || Binlog_stmt_cache_size | 32768 | | Binlogging_impossible_mode | Ignore_error | | Expire_logs_days | 0 | | General_log | OFF | | General_log_file | 2014-0831-1223.log | | Innodb_api_enable_binlog | OFF | | Innodb_flush_log_at_timeout | 1 | | Innodb_flush_log_at_trx_commit | 1 | | Innodb_locks_unsafe_for_binlog | OFF | | Innodb_log_buffer_size | 5242880 | | Innodb_log_compressed_pages | On | | Innodb_log_file_size | 50331648 | | Innodb_log_files_in_group | 2 | | Innodb_log_group_home_dir |. \ | | Innodb_mirrored_log_groups | 1 | | Innodb_online_alter_log_max_size | 134217728 | | Innodb_undo_logs | 128 | | Log_bin | OFF | | Log_bin_basename | || Log_bin_index | || log_bin_trust_function_creators | OFF | | log_bin_use_v1_row_events | OFF | | Log_error |. \2014-0831-1223.err | | Log_output | FILE | | log_queries_not_using_indexes | OFF | | Log_slave_updates | OFF | | log_slow_admin_statements | OFF | | log_slow_slave_statements | OFF | | log_throttle_queries_not_using_indexes | 0 || log_warnings | 1 | | Max_binlog_cache_size | 18446744073709547520 | | Max_binlog_size | 1073741824 | | Max_binlog_stmt_cache_size | 18446744073709547520 | | Max_relay_log_size | 0 | | Relay_log | || Relay_log_basename | || Relay_log_index | || Relay_log_info_file | Relay-log.info | | Relay_log_info_repository | FILE | | Relay_log_purge | On | | Relay_log_recovery | OFF | | Relay_log_space_limit | 0 | | Simplified_binlog_gtid_recovery | OFF | | Slow_query_log | On | | Slow_query_log_file | 2014-0831-1223-slow.log | | Sql_log_bin | On | | Sql_log_off | OFF | | Sync_binlog | 0 | | Sync_relay_log | 10000 | | Sync_relay_log_info | 10000 |+-----------------------------------------+-------------------------+61 rows in Set (0.00 sec) Mys Ql>
2. Check if MySQL is enabled for logging
Mysql> Show variables like ' log_% '; +----------------------------------------+----------------------+| variable_name | Value |+----------------------------------------+----------------------+| Log_bin | OFF | | Log_bin_basename | || Log_bin_index | || log_bin_trust_function_creators | OFF | | log_bin_use_v1_row_events | OFF | | Log_error |. \2014-0831-1223.err | | Log_output | FILE | | log_queries_not_using_indexes | OFF | | Log_slave_updates | OFF | | log_slow_admin_statements | OFF | | log_slow_slave_statements | OFF | | log_throttle_queries_not_using_indexes | 0 || log_warnings | 1 |+----------------------------------------+----------------------+13 rows in Set (0.00 sec) mysql>
3. View MySQL's current log
Mysql> Show master status; Empty Set (0.00 sec)
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
MySQL View log