How do i run a query in MYSQL without writing it to the binary log

前端 未结 2 1120
暖寄归人
暖寄归人 2021-01-30 21:59

I want to run an import of a large file into MySQL. However, I don\'t want it written to the binary log, because the import will take a long time, and cause the slaves to fall

2条回答
  •  有刺的猬
    2021-01-30 22:11

    If you want to do this from the cli, try this, it worked for me:

    $ mysqldump old_DB | mysql --init-command="SET SQL_LOG_BIN = 0;" new_DB
    

    Possible that the "init-command" param was added in a newer MySQL version.

提交回复
热议问题