Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

closed as not a real question by quanta, Smudge, Iain, MDMarra, Scott Pack Nov 11 '11 at 23:25

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Please take the time to redact your question in a clear and understandable way. – Stephane Nov 11 '11 at 9:41

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.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.