ZBLOG

mysql FLUSH NO_WRITE_TO_BINLOG tables; 内部执行原理

The FLUSH NO_WRITE_TO_BINLOG tables command is a MySQL administrative command that flushes all tables from the query cache and prevents any further writes to the binary log. Here’s how it works internally:

  1. When you execute the FLUSH NO_WRITE_TO_BINLOG tables command, MySQL first checks if there are any active transactions that have not yet been committed or rolled back.

  2. If there are no active transactions, MySQL proceeds to flush all tables from the query cache, which removes any cached query results.

  3. Next, MySQL sets a flag that prevents any further writes to the binary log.

  4. The command then returns a success message indicating that the operation was completed successfully.

  5. Any subsequent queries executed on the server after this command will not be written to the binary log until you disable this flag by executing another statement such as FLUSH TABLES WITH READ LOCK or UNLOCK TABLES.

It’s important to note that while this command can be useful in certain scenarios, it should be used with caution as it may result in data loss if there are ongoing transactions that have not yet been committed.

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://golang.0voice.com/?id=5138

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?