打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
如何查询MySql日志
mysqlbinlog   --start-datetime="2010-11-20 00:00:00"  --stop-datetime="2010-11-21 00:00:00" 

[hx@localhost data]$ mysqlbinlogmysqlbinlog Ver 3.0 for pc-linux-gnu at i686By Monty and Sasha, for your professional useThis software comes with NO WARRANTY: This is free software,and you are welcome to modify and redistribute it under the GPL license

Dumps a MySQL binary log in a format usable for viewing or for piping tothe mysql command line client

Usage: mysqlbinlog [options] log-files-d, --database=name List entries for just this database (local log only).-D, --disable-log-bin Disable binary log. This is useful, if you enabled--to-last-log and are sending the output to the sameMySQL server. This way you could avoid an endless loop.You would also like to use it when restoring after acrash to avoid duplication of the statements you alreadyhave. NOTE: you will need a SUPER privilege to use thisoption.-f, --force-read    Force reading unknown binlog events.-?, --help          Display this help and exit.-h, --host=name     Get the binlog from server.-o, --offset=#      Skip the first N entries.-p, --password[=name] Password to connect to remote server.-P, --port=#        Use port to connect to the remote server.-j, --position=#    Deprecated. Use --start-position instead.--protocol=name     The protocol of connection (tcp,socket,pipe,memory).-r, --result-file=name Direct output to a given file.-R, --read-from-remote-server Read binary logs from a MySQL server--open_files_limit=# Used to reserve file descriptors for usage by thisprogram-s, --short-form    Just show the queries, no extra info.-S, --socket=name   Socket file to use for connection.--start-datetime=name Start reading the binlog at first event having a datetimeequal or posterior to the argument; the argument must bea date and time in the local time zone, in any formataccepted by the MySQL server for DATETIME and TIMESTAMPtypes, for example: 2004-12-25 11:25:56 (you shouldprobably use quotes for your shell to set it properly).--stop-datetime=name Stop reading the binlog at first event having a datetimeequal or posterior to the argument; the argument must bea date and time in the local time zone, in any formataccepted by the MySQL server for DATETIME and TIMESTAMPtypes, for example: 2004-12-25 11:25:56 (you shouldprobably use quotes for your shell to set it properly).--start-position=# Start reading the binlog at position N. Applies to thefirst binlog passed on the command line.--stop-position=#   Stop reading the binlog at position N. Applies to thelast binlog passed on the command line.-t, --to-last-log   Requires -R. Will not stop at the end of the requestedbinlog but rather continue printing until the end of thelast binlog of the MySQL server. If you send the outputto the same MySQL server, that may lead to an endlessloop.-u, --user=name     Connect to the remote server as username.-l, --local-load=name Prepare local temporary files for LOAD DATA INFILE in thespecified directory.-V, --version       Print version and exit.

Variables (--variable-name=value)and boolean options {FALSE|TRUE} Value (after reading options)--------------------------------- -----------------------------database                          (No default value)disable-log-bin                   FALSEforce-read                        FALSEhost                              (No default value)offset                            0port                              3306position                          4read-from-remote-server           FALSEopen_files_limit                  64short-form                        FALSEsocket                            (No default value)start-datetime                    (No default value)stop-datetime                     (No default value)start-position                    4stop-position                     18446744073709551615to-last-log                       FALSEuser                              (No default value)local-load                        (No default value)

2009.09.30 检查一个应用的问题的时候,发现通过 oracle 的 dblink 连接 mysql 进行更新等操作的时候,mysql 不会把操作的 sql 语句记录到日志文件里,有点点郁闷了

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
云计算学习素材、课件,msyql知识点讲解
MySQL数据库数据恢复的规范性操作
mysqlbinlog命令详解 Part 5 通过位置和时间查看日志
Mysql是否开启binlog日志&开启方法
mysql主从复制
内部群炸了锅,隔壁同事真删库了啊。。
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服