Title: Unsafe statement written
Last modified: April 11, 2019

---

# Unsafe statement written

 *  [djedje688](https://wordpress.org/support/users/djedje688/)
 * (@djedje688)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/unsafe-statement-written/)
 * 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](https://wordpress.org/support/users/diddledani/)
 * (@diddledani)
 * [7 years ago](https://wordpress.org/support/topic/unsafe-statement-written/#post-11462748)
 * 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.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Dani Llewellyn](https://wordpress.org/support/users/diddledani/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/unsafe-statement-written/#post-11462748)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
