Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

While restoring the Mysql dump file it throws the following error.

ERROR 1665 (HY000): Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.
Query OK, 0 rows affected (0.00 sec)

The replication configuration is as below.

my.cnf

Replication Configuration:

       server-id    = 33
       max_binlog_size=40M
       log_bin=/MySql_5.5.8/log/my-bin
       log-bin-index=/MySql_5.5.8/log/log/mysql_rpllg/my-bin.index
share|improve this question

You most likely need to set it up for mixed format so the server can decide.

binlog-format=MIXED

Statement format does not always work, especially if a statement contains variable such as CURRENT_TIMESTAMP. You can read about this here: https://mariadb.com/kb/en/mariadb/mariadb-documentation/log-files/binary-log/binary-log-formats/ - Clark Vera

share|improve this answer

First, you gotta understand what each format gives, so you can choose which one fits you better.

Row-based: Records events that affect individual table rows.

Statement-based: Records all SQL statements that make changes to data or structure of a table.

Mixed will bring both worlds together, but MariaDB or MySQL will prefer STATEMENT over ROW.

@Clark Vera answer's have the documentation for more details.

Row-based is for structures that have few queries that need to be logged and replicated, so each change in every row can be logged and replicated.

Statement-based log, in other hand, brings you a more concise log and a more efficient replication of high-volume Database, but may lose some data that wasn't considered important or didn't change the structure.

After that, you gotta keep both of your replication servers with the same log method, and you'll be good to go.

I recommend you MIXED log, as @Clark Vera said, or you can just set it as ROW in your session, and when you restart your bd, it'll be STATEMENT-based log automatically.

share|improve this answer

Try setting this in my.cnf then re-trying

binlog-format=STATEMENT
share|improve this answer
    
I think it should be ROW-based or MIXED. – quanta Dec 12 '11 at 13:35
1  
I have solved the problem. As the mysql dump files are in the row format Row-based replication is required. To configure row-based replication explicitly, modify the binlog-format parameter in my.cnf and restart MySQL: [mysqld] binlog-format=row / mixed – Aha Dec 12 '11 at 13:37

Your Answer

 
discard

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.