Checking Whether the innodb_strict_mode Values of the Source and Destination Databases Are the Same
Check whether the innodb_strict_mode values of the source and destination databases are the same. If they are different, the task may fail. You are advised to change them to the same value.
The database parameter innodb_strict_mode specifies whether to enable the strict check mode. If innodb_strict_mode is set to ON, InnoDB returns errors rather than warnings when checking for invalid CREATE TABLE, ALTER TABLE, or CREATE INDEX statement. If innodb_strict_mode is set to OFF, InnoDB uses the default syntax when checking for invalid syntax. For example, in MySQL 5.7.34, if innodb_strict_mode is set to ON and the table creation statement CREATE TABLE t1(c1 int, c2 varchar(32)) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED is executed, the error Table storage engine for 't1' doesn't have this option is reported.
In a DRS task, if innodb_strict_mode of the source database is set to OFF and innodb_strict_mode of the destination database is set to ON, no error will be reported when DDL statements are executed in the source database due to syntax errors, and an error will reported data is synchronized to the destination database. As a result, the task fails.
Failure Cause
The innodb_strict_mode values of the source and destination databases must be the same.
Handling Suggestion
- If the database is a self-managed MySQL database, run commands to change the value.
- Run the following command to check the value:
SHOW VARIABLES LIKE "innodb_strict_mode";
- Run the following command to change the value:
SET GLOBAL innodb_strict_mode = <value>;
To disable this option, set <value> to 0. To enable this option, set <value> to 1.
- Run the following command to check the value:
- If the database is an RDS for MySQL DB instance, change the value of the innodb_strict_mode parameter by referring to Modifying Parameters of an RDS for MySQL Instance.
For details about how to change the value of innodb_strict_mode for other types of databases, see the usage guide of the corresponding database.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot