Mysql logbin Data Log Recovery database, mysqllogbin

Source: Internet
Author: User

Mysql logbin Data Log Recovery database, mysqllogbin


========================================================== ====================

BINLOG export SQL File
========================================================== ====================

C: \ Program Files \ MySQL Server 5.7 \ bin> mysqlbinlog binlogpath> sqlfilepath-d dbname-f -- stop-datetime stopdatetime -- start-datetime startdatetime

------------- Parameter description ----------------

Binlogpath BINLOG full path (D: \ data_backup \ mysql_binlog \ bin-log.000013)

Full path to the SQL file exported from sqlfilepath: (d: \ a.13.11. SQL)

Stopdatetime BINLOG: (T13: 33: 26)

Startdatetime BINLOG export Start Time: (T09: 43: 02)

Dbname BINLOG export filtered data name

 


========================================================== ====================

Execute an SQL file using the command line
========================================================== ====================

Mysql-f-uroot-ppwd-Ddbname <file

---------- Parameter description -------------

-F ignore error and continue execution

-U database username

-P Data pwd special character Escape Character ^

-D: target database of the execution File

Full path of the SQL file executed by file

 
========================================================== ====================

Another new BINLOG file mysql command is run.
========================================================== ====================

Flush logs;

 

 

 

========================================================== ====================

BAT executes multiple files for mysql and records the completion time log, which needs to be optimized to

========================================================== ====================

@ Echo off
Mysql-uroot-ppwd-Ddbname <D: \ cc \ bin-log.000010. SQL
Set d = % date :~ 0, 10%
Set t = % time :~ 0, 8%
Echo % d % t % bin-log.000010. SQL execed> d: \ cc \ result.txt

Mysql-uroot-p1q2w3e4r5t ^ Y ^ & U * I (O) P-Dleizuwenhuadb <D: \ cc \ bin-log.000011. SQL
Set d1 = % date :~ 0, 10%
Set t1 = % time :~ 0, 8%
Echo % d1 % t1 % bin-log.000011. SQL execed> d: \ cc \ result.txt

Mysql-uroot-p1q2w3e4r5t ^ Y ^ & U * I (O) P-Dleizuwenhuadb <D: \ cc \ bin-log.000012. SQL
Set d2 = % date :~ 0, 10%
Set t2 = % time :~ 0, 8%
Echo % d2 % t2 % bin-log.000012. SQL execed> d: \ cc \ result.txt

Mysql-uroot-p1q2w3e4r5t ^ Y ^ & U * I (O) P-Dleizuwenhuadb <D: \ cc \ bin-log.000013. SQL
Set d3 = % date :~ 0, 10%
Set t3 = % time :~ 0, 8%

Echo % d3 % t3 % bin-log.000013. SQL execed> d: \ cc \ result.txt
Echo % d3 % t3 % all exec complate> d: \ cc \ result.txt

Pause

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.