小标
2018-08-20
来源 :
阅读 3530
评论 0
摘要:本文主要向大家介绍了MySQL数据库之MySQL之show binlog events介绍 ,通过具体的内容向大家展现,希望对大家学习MySQL数据库有所帮助。
本文主要向大家介绍了MySQL数据库之MySQL之show binlog events介绍 ,通过具体的内容向大家展现,希望对大家学习MySQL数据库有所帮助。
show binlog events;只查看第一个binlog文件的内容:
mysql> show binlog events;
+------------------+-----+-------------+------------+-------------+--------------------------------------------------------------------------------------------------+
| Log_name | Pos | Event_type | Server_id | End_log_pos | Info |
+------------------+-----+-------------+------------+-------------+--------------------------------------------------------------------------------------------------+
| mysql-bin.000019 | 4 | Format_desc | 1132333306 | 120 | Server ver: 5.6.36-log, Binlog ver: 4 |
| mysql-bin.000019 | 120 | Query | 1132333306 | 196 | BEGIN |
| mysql-bin.000019 | 196 | Query | 1132333306 | 363 | update mysql.user set password=password(‘Zykj@558996321‘) where user=‘root‘ and host=‘127.0.0.1‘ |
| mysql-bin.000019 | 363 | Query | 1132333306 | 440 | COMMIT |
| mysql-bin.000019 | 440 | Query | 1132333306 | 519 | flush privileges |
| mysql-bin.000019 | 519 | Stop | 1132333306 | 542 | |
+------------------+-----+-------------+------------+-------------+--------------------------------------------------------------------------------------------------+
6 rows in set (0.00 sec)
查看所有的binlog:
mysql> show master logs;
+------------------+-----------+
| Log_name | File_size |
+------------------+-----------+
| mysql-bin.000019 | 542 |
| mysql-bin.000020 | 143 |
| mysql-bin.000021 | 543 |
| mysql-bin.000022 | 1681 |
| mysql-bin.000023 | 385 |
| mysql-bin.000024 | 1708 |
| mysql-bin.000025 | 2521 |
+------------------+-----------+
7 rows in set (0.00 sec)
查看当前正在写入的binlog文件:
mysql> show master status\G
*************************** 1. row ***************************
File: mysql-bin.000025
Position: 2521
Binlog_Do_DB:
Binlog_Ignore_DB:
Executed_Gtid_Set:
1 row in set (0.00 sec)
查看指定binlog文件的内容:mysql> show binlog events in ‘mysql-bin.000025‘;
经过测试:对mysql默认的库操作,是支持对update ,delete,alter,create ,revoke,grant,drop操作的sql语句记录的。但是对新建库进行DDL的操作SQL语句例如:create,drop ,alter 才可以查看得
本文由职坐标整理并发布,希望对同学们学习MySQL有所帮助,更多内容请关注职坐标数据库MySQL数据库频道!
喜欢 | 2
不喜欢 | 1
您输入的评论内容中包含违禁敏感词
我知道了

请输入正确的手机号码
请输入正确的验证码
您今天的短信下发次数太多了,明天再试试吧!
我们会在第一时间安排职业规划师联系您!
您也可以联系我们的职业规划师咨询:
版权所有 职坐标-一站式AI+学习就业服务平台 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
沪公网安备 31011502005948号