-2

I use mysql replication. At slave, i read in aa.err Statement may not be safe to log in statement format. Statement: update idv_product set visit = visit+1 where id = '173' limit 1 I don`t understad, guide me about error above.

1
  • 3
    Please take the time to redact your question in a clear and understandable way.
    – Stephane
    Nov 11, 2011 at 9:41

1 Answer 1

1

That error message happens because the statement relies on the order that the records are stored on disk. There are a few things you can do to stop the error happening:

  1. Use row-based replication or mixed replication instead of statement based replication.
  2. Make sure the field you are using in the WHERE clause is the primary key (I don't think unique keys are enough to stop the error message even though they are adequate to stop the error.)
  3. Remove the LIMIT 1 clause from the query. If id is unique then the query will still only update one row.
  4. Use an ORDER BY clause on a unique key in the affected queries. This doesn't make sense for the query you supplied but does for certain other queries that cause this error message.

Some more reading on this error message.

Not the answer you're looking for? Browse other questions tagged .