简体   繁体   中英

MySQL binary log after restore

I've got an issue with a legacy system I've inherited. Every night a dump from live is run (to script) and restored to QA from said script eg:

mysql [params] < path/to/backup.sql

This causes the creation of lots data in the bin logs (DB is a few gigabytes). The bin logs don't seem to get flushed automatically - I can clear them down by running RESET MASTER; from the mysql command line but was wondering if there was any way to automate this? It's running on mysql 4.0.21 under Windows.

EDIT: It's not running as a master to any slave dbs

flush logs
or update & restart mysql server by comment out log-bin = xxx , but this will disabled the replication

The following will disable sql statements being logged to binary.

mysql> set sql_log_bin=0
mysql> source path/to/backup.sql

This applies to current thread only and is much faster.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM