MySQL Binlog open and view under Window, Mysqlbinlog

Source: Internet
Author: User

See if Binlog is turned on:

win+r = cmd = connect mysql=>show variables like ' log_% ';

Mysql> Show variables like ' log_% '; +---------------------------------+-------------+| Variable_name                   | Value       |+---------------------------------+-------------+| log_bin                         | On          | | log_bin_trust_function_creators | OFF         | | log_error                       |. \mysql.err | | log_queries_not_using_indexes   | OFF         | | log_slave_updates               | OFF         | | log_slow_queries                | On          | | log_warnings                    | 1           |+---------------------------------+-------------+

The value that does not open log_bin is off, on after opening

Open Binlog:

Modify the MySQL configuration file My.ini (in C:\ProgramData\MySQL\MySQL Server 5.6)

Add configuration: Log-bin=log-bin=d:\appserv/mysql/log/mysql-bin.log test discovery must give full path (name free)

Restarting MySQL will add two files to the log directory mysql-bin.000001 and Mysql-bin.index

View Binlog:

win+r = cmd = connect mysql=> show binary logs; = = You can see the name of your Binlog

win+r = cmd = connect mysql=> show Binlog events; = = To view the generated Binlog

Export to a text file:

D:\appserv\mysql\bin>mysqlbinlog >d:/test.txt

Make sure you have Mysqlbinlog.exe in the bin directory. Search download

MySQL using Mysqlbinlog to view log issues

Mysqlbinlog mysql-bin.00005--startdatetime= ' time '--stopdatetime= ' time '--database=db_name | Grep-i-A 6 ' id=111 '

With grep.

Where is the binlog location for MySQL under Windows, and the version is 515

Binary files in the data directory,
Can be executed again on the MySQL command line, show variables like '%datadir% '; View data path

MySQL Binlog open and view under Window, Mysqlbinlog

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.