免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: scc_166
打印 上一主题 下一主题

求助: 数据库资料被修改,在binlog却找不到修改记录 [复制链接]

论坛徽章:
9
每日论坛发贴之星
日期:2016-01-04 06:20:00数据库技术版块每日发帖之星
日期:2016-01-04 06:20:00每日论坛发贴之星
日期:2016-01-04 06:20:00数据库技术版块每日发帖之星
日期:2016-01-04 06:20:00IT运维版块每日发帖之星
日期:2016-01-04 06:20:00IT运维版块每日发帖之星
日期:2016-01-04 06:20:00综合交流区版块每日发帖之星
日期:2016-01-04 06:20:00综合交流区版块每日发帖之星
日期:2016-01-04 06:20:00数据库技术版块每周发帖之星
日期:2016-03-07 16:30:25
11 [报告]
发表于 2009-11-27 11:37 |只看该作者
原帖由 scc_166 于 2009-11-27 10:38 发表
就是简单的update table set xxx=yyy修改语句

my.cn中的设置只有:
log-bin=mysql-bin
binlog_format=mixed

现在在binlog中找不到修改后的数据

mysqlbinlog mysql-bin.000001 |grep 'yyy'

像这样执行的



那有可能数据不是像update tbl set xxx='yyy' 这样修改的。
说不定是被  update tbl set xxx=(select xxx from tbl2) 这样修改的。
所以查不到修改后的值。

lz再按照表名或者列名查查看。

论坛徽章:
8
综合交流区版块每周发帖之星
日期:2015-12-02 15:03:53数据库技术版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每日发帖之星
日期:2015-09-14 06:20:00金牛座
日期:2014-10-10 11:23:34CU十二周年纪念徽章
日期:2013-10-24 15:41:34酉鸡
日期:2013-10-19 10:17:1315-16赛季CBA联赛之北京
日期:2017-03-06 15:12:44
12 [报告]
发表于 2009-11-27 12:24 |只看该作者
mysql版本是多少?

在mysql.cnf里面配置tee记录所有客户端的操作和binglog匹对看看

论坛徽章:
0
13 [报告]
发表于 2009-11-27 13:01 |只看该作者
之前已经使用列名查找过了,同样找不到记录

tee 已经加在[mysql]下面
tee = /tmp/client.log

我试着在shell下连接数据表并执行select,然后退出,好像没有写入到文件client.log中

另外试着换到[client]下面同样的client.log中也没有数据

# ll client.log
-rw-r--r--  1 mysql  wheel  0 Nov 27 12:58 client.log

mysql-5.1.36 freebsd-ports安装

[ 本帖最后由 scc_166 于 2009-11-27 13:33 编辑 ]

论坛徽章:
8
综合交流区版块每周发帖之星
日期:2015-12-02 15:03:53数据库技术版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每日发帖之星
日期:2015-09-14 06:20:00金牛座
日期:2014-10-10 11:23:34CU十二周年纪念徽章
日期:2013-10-24 15:41:34酉鸡
日期:2013-10-19 10:17:1315-16赛季CBA联赛之北京
日期:2017-03-06 15:12:44
14 [报告]
发表于 2009-11-27 14:28 |只看该作者
mysql>?
下面没有tee输出?

论坛徽章:
8
综合交流区版块每周发帖之星
日期:2015-12-02 15:03:53数据库技术版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每日发帖之星
日期:2015-09-14 06:20:00金牛座
日期:2014-10-10 11:23:34CU十二周年纪念徽章
日期:2013-10-24 15:41:34酉鸡
日期:2013-10-19 10:17:1315-16赛季CBA联赛之北京
日期:2017-03-06 15:12:44
15 [报告]
发表于 2009-11-27 14:29 |只看该作者
修改cnf文件后要reload mysqld

论坛徽章:
0
16 [报告]
发表于 2009-11-27 14:35 |只看该作者
>?
tee       (\T) Set outfile [to_outfile]. Append everything into given outfile.

每次改动my.cnf都重启过mysql

论坛徽章:
0
17 [报告]
发表于 2009-11-27 14:38 |只看该作者
>tee client.log
Logging to file 'client.log'
>select count(*) from table;

这样的有效,my.cnf加入的无效

论坛徽章:
0
18 [报告]
发表于 2009-11-27 14:43 |只看该作者
悲剧~~~

论坛徽章:
8
综合交流区版块每周发帖之星
日期:2015-12-02 15:03:53数据库技术版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每日发帖之星
日期:2015-09-14 06:20:00金牛座
日期:2014-10-10 11:23:34CU十二周年纪念徽章
日期:2013-10-24 15:41:34酉鸡
日期:2013-10-19 10:17:1315-16赛季CBA联赛之北京
日期:2017-03-06 15:12:44
19 [报告]
发表于 2009-11-27 15:14 |只看该作者
下面是我的测试

[mysql]
prompt=\\U:\\d \\R:\\m:\\s>
#prompt=\\U:\\d \\D>
tee=/tmp/myaction.log

touch /tmp/myaction.log
restart mysqld

-bash-3.1# cat /tmp/myaction.log
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.45 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

root@localhost:(none) 15:10:06>use test;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
root@localhost:test 15:10:08>show tables;
+----------------+
| Tables_in_test |
+----------------+
| t1             |
| t2             |
| t3             |
| test_inc       |
| userinfo       |
+----------------+
5 rows in set (0.00 sec)

root@localhost:test 15:10:11>desc t1;
+-------+---------+------+-----+---------+-------+
| Field | Type    | Null | Key | Default | Extra |
+-------+---------+------+-----+---------+-------+
| a     | int(11) | NO   |     | 0       |       |
+-------+---------+------+-----+---------+-------+
1 row in set (0.00 sec)

root@localhost:test 15:10:13>select * from t1;
+---+
| a |
+---+
| 1 |
| 2 |
| 3 |
+---+
3 rows in set (0.00 sec)

root@localhost:test 15:11:39>update t1 set a=3 where a=3;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1  Changed: 0  Warnings: 0

root@localhost:test 15:11:51>select * from t1;
+---+
| a |
+---+
| 1 |
| 2 |
| 3 |
+---+
3 rows in set (0.00 sec)

root@localhost:test 15:11:52>update t1 set a=4 where a=3;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

root@localhost:test 15:12:00>select * from t1;
+---+
| a |
+---+
| 1 |
| 2 |
| 4 |
+---+
3 rows in set (0.00 sec)

root@localhost:test 15:12:03>exit
-bash-3.1#

[ 本帖最后由 ruochen 于 2009-11-27 15:15 编辑 ]

论坛徽章:
8
综合交流区版块每周发帖之星
日期:2015-12-02 15:03:53数据库技术版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每日发帖之星
日期:2015-09-14 06:20:00金牛座
日期:2014-10-10 11:23:34CU十二周年纪念徽章
日期:2013-10-24 15:41:34酉鸡
日期:2013-10-19 10:17:1315-16赛季CBA联赛之北京
日期:2017-03-06 15:12:44
20 [报告]
发表于 2009-11-27 15:16 |只看该作者
原帖由 scc_166 于 2009-11-27 10:01 发表
今天发现数据库中资料被修改了,几乎是刚刚被修改马上就被发现的。

在查找binlog时却找不找修改的记录, 这是为什么呢?

my.cnf中是开了binlog的,另外被修改前几分钟的其他数据都可以查找到,就是这条被修 ...



客户端是通过jdbc、odbc之类的连接上来的么?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP