How to fix Magento Database import mysql error 1031?

Recently we got many questions about mysql error 1031 when they try to import magento database .sql file. We decide to make this tutorial article to help them solve it easier and maybe other programmers.

Mysql Magento Error 1031

Mysql Magento Error 1031

When you import .sql file you can see the error like this

ERROR 1031 (HY000) at line 291001: Table storage engine for 'catalog_product_relation' doesn't have this option

This is well known issue so let’s do this solution

Problem: ROW_FORMAT=FIXED

Let’s check if this is your problem (Ex: magento-db-dump.sql).

cat magento-db-dump.sql | grep '=FIXED'

You will see result like this

) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Catalog Product Relation Table';
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Catalog Product To Website Linkage Table';

Let’s use one of these command to fix your magento .sql file

Command #1

sed -i 's/ROW_FORMAT=FIXED//g' magento-db-dump.sql

Command #2

sed -i '' 's/ROW_FORMAT=FIXED//g' magento-db-dump.sql

Command #3

LC_ALL=C sed -i '' 's/ROW_FORMAT=FIXED//g' magento-db-dump.sql

One of these command should work and then import your database again with this command

mysql -u <user> -p <db-name> < magento-db-dump.sql

For the online hosting, you need to make sure the server, hosting or vps were designed for magento to get it work well. You can check our list about best magento host solution
Refs: stackexchange, magepsycho

Leave a Reply

Your email address will not be published. Required fields are marked *

*