Limiting the MySQL error log file size

Sathiska asked:

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?

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.

My answer:

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

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.