• Hi,

    I am working on Ubuntu 14 with MariaDB and Apache.
    On my syslog file, i have a lot of message like this :

    Apr 11 10:41:10 web-ftp mysqld: 190411 10:41:10 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE  on a table with more than one UNIQUE KEY is unsafe Statement: 
    INSERT INTO <code>wp_options</code> (<code>option_name</code>, <code>option_value</code>, <code>autoload</code>) VALUES ('_transient_doing_cron', '1554972070.7150549888610839843750', 'yes') ON DUPLICATE KEY UPDATE <code>option_name</code> = VALUES(<code>option_name</code>), <code>option_value</code> = VALUES(<code>option_value</code>), <code>autoload</code> = VALUES(<code>autoload</code>)

    Do you know how to resolve this ? I have no idea…

    Thanks,

Viewing 1 replies (of 1 total)
  • Dani Llewellyn

    (@diddledani)

    If your MySQL database isn’t replicated you should be OK with switching off the binary log. The issue arises because the statement being executed has ON DUPLICATE KEY UPDATE which is unsafe in a replicated environment because MySQL replication isn’t atomic so when the binlog is replayed on a different server there is a chance it could update a subsequently-inserted record that wasn’t there when the original query ran.

Viewing 1 replies (of 1 total)

The topic ‘Unsafe statement written’ is closed to new replies.