MySQL Online change binlog format

Source: Internet
Author: User

Today's changes to JBoss error are as follows:

' HY000 ' ' 1592 ' inch which rows is retrieved determines what (if any) rows would be written. This order cannot is predicted and may differ on master and the slave.]

Tip: Warning, it is unsafe to select a table from another table with an AutoIncrement column, because the order in which rows are retrieved determines which rows, if any, will be written. This command is unpredictable and will make the master-slave data inconsistent.

The Binglog format for modifying the main library and from the library is changed from statement to row format.

Method:

1, first modify from the library

Mysql> Show global variables like"binlog%";+-----------------------------------------+--------------+| variable_name | Value |+-----------------------------------------+--------------+| Binlog_cache_size |32768|| Binlog_checksum | CRC32 | | Binlog_direct_non_transactional_updates | OFF | | binlog_error_action | Ignore_error | | Binlog_format | MIXED | | Binlog_gtid_simple_recovery | OFF | | Binlog_max_flush_queue_time |0|| Binlog_order_commits | On | | Binlog_row_image | Full | | binlog_rows_query_log_events | OFF | | Binlog_stmt_cache_size |32768|| Binlogging_impossible_mode | Ignore_error |+-----------------------------------------+--------------+ ARowsinchSet (0.00Sec
Mysql> set global binlog_format=0 rows affected (0.00  sec) MySQL"  Binlog_format"; +---------------+-------+| variable_name | Value |+---------------+-------+| Binlog_format | ROW   |+---------------+-------+1 in Set (0.00 sec)

2, in the modification of the main library

Mysql> set global binlog_format=0 rows affected (0.00  sec) MySQL"  Binlog_format"; +---------------+-------+| variable_name | Value |+---------------+-------+| Binlog_format | ROW   |+---------------+-------+1 in Set (0.00 sec)

3. Modify the configuration file my.cnf

Binlog_format=row

If you modify the main library first, you may get the following error.

1666               'cannot execute statement:impossible to write to binary log since statement are in row Format and Binlog_format = STATEMENT. '

Welcome reprint, please indicate the source!

MySQL Online change binlog format

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.