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'm using MySQL enterprise edition for large database. When running several queries following error message logged into error log file.

Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctly.

This causes increased disk usage, and I need to control this situation.

Is there any way to rotate the error logs (as it is done for access logs)? Or is there a way to control the maximum file size for the error log?

Summary: When running several queries, this error message is logged to the error log. Therefore our disk is filling up. I need to limit the error log size or apply log rotation.

share|improve this question

Forget reducing the size of the error logs, fix the problem. Change your binlog_format to mixed (preferred) or row.

share|improve this answer
I need to control error log. Bin log is OK. But error log size cannot be limit. – Sathiska Jun 29 '13 at 4:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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