1

I m getting this error while import database from server to local host.

There has been an error processing your request

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '415436' for key 'PRIMARY'

Trace:
#0 C:\xampp\htdocs\surtikart\lib\Varien\Db\Statement\Pdo\Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 C:\xampp\htdocs\surtikart\app\code\core\Zend\Db\Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 C:\xampp\htdocs\surtikart\lib\Zend\Db\Adapter\Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 C:\xampp\htdocs\surtikart\lib\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `lo...', Array)
#4 C:\xampp\htdocs\surtikart\lib\Varien\Db\Adapter\Pdo\Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `lo...', Array)
#5 C:\xampp\htdocs\surtikart\lib\Zend\Db\Adapter\Abstract.php(576): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `lo...', Array)
#6 C:\xampp\htdocs\surtikart\app\code\core\Mage\Log\Model\Resource\Visitor.php(174): Zend_Db_Adapter_Abstract->insert('log_visitor_inf...', Array)
#7 C:\xampp\htdocs\surtikart\app\code\core\Mage\Log\Model\Resource\Visitor.php(108): Mage_Log_Model_Resource_Visitor->_saveVisitorInfo(Object(Mage_Log_Model_Visitor))
#8 C:\xampp\htdocs\surtikart\app\code\core\Mage\Core\Model\Resource\Db\Abstract.php(463): Mage_Log_Model_Resource_Visitor->_afterSave(Object(Mage_Log_Model_Visitor))
#9 C:\xampp\htdocs\surtikart\app\code\core\Mage\Core\Model\Abstract.php(318): Mage_Core_Model_Resource_Db_Abstract->save(Object(Mage_Log_Model_Visitor))
#10 C:\xampp\htdocs\surtikart\app\code\core\Mage\Log\Model\Visitor.php(168): Mage_Core_Model_Abstract->save()
#11 C:\xampp\htdocs\surtikart\app\code\core\Mage\Core\Model\App.php(1338): Mage_Log_Model_Visitor->initByRequest(Object(Varien_Event_Observer))
#12 C:\xampp\htdocs\surtikart\app\code\core\Mage\Core\Model\App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Log_Model_Visitor), 'initByRequest', Object(Varien_Event_Observer))
#13 C:\xampp\htdocs\surtikart\app\Mage.php(448): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
#14 C:\xampp\htdocs\surtikart\app\code\core\Mage\Core\Controller\Varien\Action.php(527): Mage::dispatchEvent('controller_acti...', Array)
#15 C:\xampp\htdocs\surtikart\app\code\core\Mage\Core\Controller\Front\Action.php(64): Mage_Core_Controller_Varien_Action->preDispatch()
#16 C:\xampp\htdocs\surtikart\app\code\core\Mage\Core\Controller\Varien\Action.php(407): Mage_Core_Controller_Front_Action->preDispatch()
#17 C:\xampp\htdocs\surtikart\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
#18 C:\xampp\htdocs\surtikart\app\code\core\Mage\Core\Controller\Varien\Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#19 C:\xampp\htdocs\surtikart\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#20 C:\xampp\htdocs\surtikart\app\Mage.php(684): Mage_Core_Model_App->run(Array)
#21 C:\xampp\htdocs\surtikart\index.php(94): Mage::run('', 'store')
#22 {main}

Error log record number: 1833631927

Magento is a trademark of Magento Inc. Copyright © 2014 Magento Inc.
3
  • try disabling Foreign Key Checks while importing Jun 28 '16 at 6:42
  • Best way to export database is truncate all log tables that will reduce database size log_customer , log_quote , ` log_summary` , log_summary_type , log_url , log_url_info , log_visitor , log_visitor_info , log_visitor_online and then export database with single transaction that will not create these type of problems.
    – Aman Alam
    Jun 28 '16 at 6:56
  • Done.. Thank you so much Anil Suthar Sir and Aman Alam Sir for this support..
    – Sweety
    Jun 28 '16 at 8:40
1

Looking at your error trace I can see that row with id 415436 is already exist in your table log_visitor and you are trying to insert another one with same id.

Basically this is sql error, that ID field is unique and it cannot be same as it already exist in table.

You can remove this row from table or just remove data (associated with this id 415436) from your exported sql.

This should help.

4
  • Thank you so much for your suggestion ...But there are many tables .. I cant judge in which table i have to modify..
    – Sweety
    Jun 28 '16 at 6:49
  • You can delete all data of log. Check @Aman Alam's comment in your qst. So you will just delete all "insert in to log...." from your exported sql file. Jun 28 '16 at 6:58
  • Done .. Thank you so much Adarsh Khatri Sir for this support.
    – Sweety
    Jun 28 '16 at 8:41
  • Great it was helpful. Jun 28 '16 at 8:52

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.