网站友链查询接口,保洁网站模板,四川公共资源交易信息网,网站对网络营销的作用mysqlbinlog用法如下#xff1a;mysqbinlog mysql.err 查询错误日志当然可以通过添加参数来查看指定内容,如#xff1a;mysqlbinlog mysql-bin.000001 -d test 只显示对test数据库的二进制日志mysqlbinlog mysql-bin.000001 -o 3 -r result-file 首先忽略前三个操作mysqbinlog mysql.err 查询错误日志当然可以通过添加参数来查看指定内容,如mysqlbinlog mysql-bin.000001 -d test 只显示对test数据库的二进制日志mysqlbinlog mysql-bin.000001 -o 3 -r result-file 首先忽略前三个操作并将日志结果输出到result-file文件中mysqlbinlog相关参数--base64-output[name]Determine when the output statements should bebase64-encoded BINLOG statements: never disables it andworks only for binlogs without row-based events;decode-rows decodes row events into commented SQLstatements if the --verbose option is also given; autoprints base64 only when necessary (i.e., for row-basedevents and format description events); always printsbase64 whenever possible. always is for debugging onlyand should not be used in a production system. If thisargument is not given, the default is auto; if it isgiven with no argument, always is used.--character-sets-dirnameDirectory for character set files.-d, --databasename List entries for just this database (local log only).--debug-check Check memory and open file usage at exit .--debug-info Print some debug info at exit.-D, --disable-log-binDisable 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-if-open Force if binlog was not closed properly.-f, --force-read Force reading unknown binlog events.-H, --hexdump Augment output with hexadecimal and ASCII event dump.-h, --hostname Get the binlog from server.-l, --local-loadnamePrepare local temporary files for LOAD DATA INFILE in thespecified directory.-o, --offset# Skip the first N entries.-p, --password[name]Password to connect to remote server.-P, --port# Port number to use for connection or 0 for default to, inorder of preference, my.cnf, $MYSQL_TCP_PORT,/etc/services, built-in default (3306).--position# Deprecated. Use --start-position instead.--protocolname The protocol to use for connection (tcp, socket, pipe,memory).-R, --read-from-remote-serverRead binary logs from a MySQL server.-r, --result-filenameDirect output to a given file.--server-id# Extract only binlog entries created by the server havingthe given id.--set-charsetname Add SET NAMES character_set to the output.-s, --short-form Just show regular queries: no extra info and no row-basedevents. This is for testing only, and should not be usedin production systems. If you want to suppressbase64-output, consider using --base64-outputneverinstead.-S, --socketname The socket file to use for connection.--start-datetimenameStart 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).-j, --start-position#Start reading the binlog at position N. Applies to thefirst binlog passed on the command line.--stop-datetimenameStop 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-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, --username Connect to the remote server as username.-v, --verbose Reconstruct SQL statements out of row events. -v -v addscomments on column data types.-V, --version Print version and exit.--open_files_limit#Used to reserve file descriptors for use by this program.在使用mysqlbinlog查看二进制日志时会出现mysqlbinlog: unknown variable default-character-setutf8解决办法1、mysqlbinlog --no-defaults mysql-bin.0000012、修改my.cnf#default-character-setutf8因为mysqlbinlog会重新从my.cnf中读取不是从内存中读取使用完毕之后再修改过来即可