Home > database >  Mysql binlog 5.7.17 old version resume the SQL unable to import the database problems
Mysql binlog 5.7.17 old version resume the SQL unable to import the database problems

Time:09-18

Using mysqlbinlog back out the insert statement cannot execute SQL files, report the following error:
Restore command:/usr/local/mysql/5.7.17/bin/mysql - uXXXX - p & lt; SQL
/TMP/re2.Parts of the source SQL script file statement: insert into excessorder (userid, citycode, cmtokenid, filename) values (' 15850
13, 990906 ', 'JSHDC - ASPIRE - fabf9e6c - ee16-4914 - a810 - fe048242b40e', 'moh00420y')
an error is as follows:
ERROR 1062 (23000) at line 84: Duplicate entry '987437' for key 'PRIMARY'
After the SQL script to modify the source: insert ignore into excessorder (userid, citycode, cmtokenid, filename) values (' 15850
13, 990906 ', 'JSHDC - ASPIRE - fabf9e6c - ee16-4914 - a810 - fe048242b40e', 'moh00420y')
an error is as follows:
ERROR 1766 (HY000) at line 5883: The system variable explicit_defaults_for_timestamp always be set when there is an ongoing transaction.
SQL script to modify the source file is as follows: commented out the parameter SET @ @ session. Explicit_defaults_for_timestamp=0/*! */.
# SET @ @ session. Explicit_defaults_for_timestamp=0/*! */.
question 1: I don't know, what will this explicit_defaults_for_timestamp commented?
Question 2: before the binlog recovery have insert statement is correct, modified to insert ignore into there is no better way,

CodePudding user response:

1. This parameter is to control the timestamp type field in the update data row is automatically updated to the current time,
2. Your insert statement error because the primary key conflict, the first thing to do is to check your binlog data parsing out whether there is with the current data repeat, rather than directly ignore,

CodePudding user response:

Like this problem, after login mysql directly, the source is not an error, and strange things,
  • Related