How to view MySQL binary logs

Source: Internet
Author: User
Tags mysql update

MySQL binary logs are often used. How can I view MySQL binary logs? The following describes how to view the MySQL binary log for your reference.

MySQL binary log:

From the overview, I can see that the log-bin of my. ini configuration information does not specify the file extension, because it is not used even if you specify the extension. When mysql creates a binary log file, it first creates a file named "mysql_log_bin" and named ". index, and create a file named "mysql_log_bin" with the suffix ". 000001. When the mysql service is restarted once, A file with a suffix of 000001 is added, and the suffix name is incremented by 1. If the log length exceeds the upper limit of max_binlog_size, the default value is 1 GB.) A new log file is created; use the flush logsmysql command) or execute the mysqladmin-u-p flush-logswindows command prompt) to create a new log file.

Since MySQL binary data is written, normal data cannot be seen when you open a file in Notepad. How can we view it?

Use the mysqlbinlog command in the BIN directory, for example:
Bin> mysqlbinlog d:/mysql_log/mysql_bin.000001
Bin> mysqlbinlog d:/mysql_log/mysql_bin.000002
Bin> mysqlbinlog d:/mysql_log/mysql_bin.000003
Bin> mysqlbinlog d:/mysql_log/mysql_bin.000004
Bin> mysqlbinlog d:/mysql_log/mysql_bin.000005

You can also use SQL statements to view the binary file directory created by mysql:

Mysql> show master logs; view the current binary file status:

Mysql> show master status;

Mysql bin log files clear sh instances

How to use the new MySQL Update log

How to relocate the MySQL DATA DIRECTORY

MySQL database table Representation

How to change the MySQL Data File Path

Related Article

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.