1

When we try to import products through the backend, we get an error that says foreign keys are not correct.

I went to run the Database Repair Tool. I made a copy of our current db called dbrepair and made a clean install db called dbrepairref when I try to run the tool it says "Corrupted database doesn't support InnoDB storage engine". I am not sure what to do from here to fix the problem.

  • What MySQL version are you using? – Ben Lessani - Sonassi Jul 3 '15 at 18:04
  • Server type: MySQL Server version: 5.6.19-log - MySQL Community Server (GPL) Protocol version: 10 – steakbbq Jul 6 '15 at 16:33
  • That'll be the issue. Magento had to provide a patch to support MySQL 5.6 - as the means they used to detect the version is no longer a command in MySQL 5.6. The patch suggested below is correct, magento.stackexchange.com/a/73070/361 – Ben Lessani - Sonassi Jul 6 '15 at 16:36
  • I found where the db repair tool checks for innodb support and this is what it is, I'm guessing there is some kind of old mysql there as well? LINK TO GIST – steakbbq Jul 7 '15 at 12:55
  • Also this is the installer code, We upgraded from 1.7 to 1.9, Our main issue right now is when we go tto import products through the cms system->import/export->import we get this error LINK TO ANOTHER GIST How would the installer code have anything to do with that? – steakbbq Jul 7 '15 at 13:01
2

plese read answer:- Line 59 of the file app/code/core/Mage/Install/Model/Installer/Db/Mysql4.php

Replace: public function supportEngine() { $variables = $this->_getConnection() ->fetchPairs('SHOW VARIABLES'); return (!isset($variables['have_innodb']) || $variables['have_innodb'] != 'YES') ? false : true; }

with this:

public function supportEngine() { $variables = $this->_getConnection() ->fetchPairs('SHOW ENGINES'); return (isset($variables['InnoDB']) && $variables['InnoDB'] != 'NO'); }

  • How does this have anything to do with the database repair tool? Why would I edit the magento core code? magentocommerce.com/wiki/1_-_installation_and_configuration/… I am running a php file called magento-db-repair-tool-1.0.php – steakbbq Jul 3 '15 at 14:48
  • You need this fix for mysql 5.6 and higher on magento versions below 1.8 if I'm correct. You need this if you know for sure that innodb is enabled I your database server, but Magento isn't able to detect it. However it's part of installer code, doubtful that the db repair tool is reusing that code. But possible. – Melvyn Jul 3 '15 at 19:57
  • We upgraded from 1.7 to 1.9 when this issue showed up. I have tried everything I can think of and I can't seem to get the import functionality to work. I posted on the magento forums but have not got a response there yet. I took a look at the db repair code and its all self contained, I was assuming that some how between the upgrade the storage engine was changed. Do I just need to switch the storage engine? – steakbbq Jul 6 '15 at 16:32
  • lol the broken part is obviously at the top of magento-db-repair.php file – MagenX May 8 '18 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.