Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL error 'core_resource' already exists

Tags:

magento

I am getting following message when I run mageno on my local host

Error in file: "D:\wamp\www\magentocustmod\app\code\core\Mage\Core\sql\core_setup\install-1.6.0.0.php" - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'core_resource' already exists

Trace:
#0 D:\wamp\www\magentocustmod\app\code\core\Mage\Core\Model\Resource\Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')
#1 D:\wamp\www\magentocustmod\app\code\core\Mage\Core\Model\Resource\Setup.php(421): Mage_Core_Model_Resource_Setup->_modifyResourceDb('install', '', '1.6.0.2')
#2 D:\wamp\www\magentocustmod\app\code\core\Mage\Core\Model\Resource\Setup.php(327): Mage_Core_Model_Resource_Setup->_installResourceDb('1.6.0.2')
#3 D:\wamp\www\magentocustmod\app\code\core\Mage\Core\Model\Resource\Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 D:\wamp\www\magentocustmod\app\code\core\Mage\Core\Model\App.php(417): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 D:\wamp\www\magentocustmod\app\code\core\Mage\Core\Model\App.php(343): Mage_Core_Model_App->_initModules()
#6 D:\wamp\www\magentocustmod\app\Mage.php(683): Mage_Core_Model_App->run(Array)
#7 D:\wamp\www\magentocustmod\index.php(87): Mage::run('', 'store')
#8 {main}

How can I fix this?

like image 205
Mukesh Avatar asked Feb 16 '23 05:02

Mukesh


1 Answers

There are many problems that can cause this error

I know that this question has already been answered, but I just ran into the same problem. The selected solution here by the OP did not solve my problem. So I created this blog post to analyze the many different causes and find the solution that worked for me. Hopefully it will be of benefit to the next person that runs into this error.

Possible Causes

  • Rolling back the database after installing an extension
  • Rolling back the database after upgrading Magento
  • During installation of a fresh Magento

Possible solutions for your situation

  • Solution 1: Restore Magento to the last working state
  • Solution 2: Update the upgrade flag for this extension as mentioned by abhijeet
  • Solution 3: Delete the database tables in question

This article was the source of my research, Base table or view already exists

like image 172
Marketing Consultant Avatar answered Feb 28 '23 04:02

Marketing Consultant