When using MySQL, you often create an auto-increment ID field in the table and use the auto-increment ID to quickly create an index. This is also a recommended method for MySQL. However, this method may cause synchronization failure due to auto-increment ID when a large amount of data is configured and master/Slave nodes are configured. First, You Need To Know That Mysql Master/Slave synchronization is mainly synchronized through the bin log, in MySQl, the maximum bin log value is 1 GB. The database is configured for master-slave synchronization. 2. The table has self-incrementing ID3, and the table has a large amount of data,
If insert into… is executed on the master... Select... When the SQL transaction exceeds 1 GB, MySQL will synchronize the SQL statement in row mode from top to bottom to insert into values (.......), at this time, the data volume exceeds 1 GB, that is, the maximum value allowed by MySQL bin log is exceeded. Therefore, the master-slave synchronization fails, only the auto-increment field can be deleted to restore the master and slave databases. Therefore, when the data volume is large and the above calculation SQL table exists, use the auto-increment field with caution.