Mysql Magento Error 1031

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

[code]ERROR 1031 (HY000) at line 291001: Table storage engine for ‘catalog_product_relation’ doesn’t have this option[/code]

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


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

[code]cat magento-db-dump.sql | grep ‘=FIXED'[/code]

You will see result like this

[code]) 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’;[/code]

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

Command #1

[code]sed -i ‘s/ROW_FORMAT=FIXED//g’ magento-db-dump.sql[/code]

Command #2

[code]sed -i ” ‘s/ROW_FORMAT=FIXED//g’ magento-db-dump.sql[/code]

Command #3

[code]LC_ALL=C sed -i ” ‘s/ROW_FORMAT=FIXED//g’ magento-db-dump.sql[/code]

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

[code]mysql -u <user> -p <db-name> < magento-db-dump.sql[/code]

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