Magento2 Wrong create options MYSQL Error

October 17, 2019 | In: How to do, How to Fix, Magento, mysql, web development

On transferring a Magento website Database running on MySQL 5.7.34 to MariaDB 10.2.39, I get the following error:

[naveenos@server2 etc]# mysql m1_db < db.sql
ERROR 1005 (HY000) at line 4080: Can't create table `catalog_product_relation` (errno: 140 "Wrong create options")

SQL Strict mode was already off on this MySQL server.

MariaDB [(none)]> select @@sql_mode;
| @@sql_mode |
|            |
1 row in set (0.00 sec)
MariaDB [(none)]>

To fix the problem, edited the db.sql file, added below line

set innodb_strict_mode = off;

at the top of the file. After this change, the restore worked without any error.