设为首页 加入收藏

TOP

mysql中的日志(一)(五)
2015-11-21 01:39:03 来源: 作者: 【 】 浏览:2
Tags:mysql 日志
-----------------------------------+ | Variable_name | Value | +---------------------------------+--------------------------------------------+ | log_bin | ON | | log_bin_basename | /data/logs/mysql/binarylog/mysql_bin | | log_bin_index | /data/logs/mysql/binarylog/mysql_bin.index | | log_bin_trust_function_creators | OFF | | log_bin_use_v1_row_events | OFF | +---------------------------------+--------------------------------------------+ mysql> show variables like '%binlog%'; +-----------------------------------------+----------------------+ | Variable_name | Value | +-----------------------------------------+----------------------+ | binlog_cache_size | 32768 | | binlog_checksum | CRC32 | | binlog_direct_non_transactional_updates | OFF | | binlog_error_action | IGNORE_ERROR | | binlog_format | MIXED | | 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 | | innodb_api_enable_binlog | OFF | | innodb_locks_unsafe_for_binlog | OFF | | max_binlog_cache_size | 18446744073709547520 | | max_binlog_size | 209715200 | | max_binlog_stmt_cache_size | 18446744073709547520 | | simplified_binlog_gtid_recovery | OFF | | sync_binlog | 0 | +-----------------------------------------+----------------------+

?

?
查看命令
?
mysql> show binary logs;
+------------------+-----------+
| Log_name         | File_size |
+------------------+-----------+
| mysql_bin.000001 |       167 |
| mysql_bin.000002 |       167 |
| mysql_bin.000003 |       167 |
| mysql_bin.000004 |       167 |
| mysql_bin.000005 |      2606 |
| mysql_bin.000006 |       143 |
| mysql_bin.000007 |       143 |
| mysql_bin.000008 |       143 |
| mysql_bin.000009 |       143 |
| mysql_bin.000010 |       143 |
| mysql_bin.000011 |       143 |
| mysql_bin.000012 |       143 |
| mysql_bin.000013 |       120 |
| mysql_bin.000014 |       120 |
+------------------+-----------+
14 rows in set (0.14 sec)

mysql> show master status;
+------------------+----------+--------------+------------------+-------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------------------+----------+--------------+------------------+-------------------+
| mysql_bin.000014 |      120 |              |                  |                   |
+------------------+----------+--------------+------------------+-------------------+
1 row in set (0.00 sec)

mysql> show binlog events;
+------------------+-----+-------------+-----------+-------------+---------------------------------------+
| Log_name         | Pos | Event_type  | Server_id | End_log_pos | Info                                  |
+------------------+-----+-------------+-----------+-------------+---------------------------------------+
| mysql_bin.000001 |   4 | Format_desc |         1 |         120 | Server ver: 5.6.25-log, Binlog ver: 4 |
| mysql_bin.000001 | 120 | Rotate      |         1 |         167 | mysql_bin.000002;pos=4                |
+------------------+-----+-------------+-----------+-------------+---------------------------------------+

?

?
分析日志
?
[root@localhost binarylog]# mysqlbinlog   --no-defaults mysql_bin.000005
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD
首页 上一页 2 3 4 5 6 下一页 尾页 5/6/6
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇MYSQL序言 下一篇rsync+inotify-tools+ssh实现mysq..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: