1

I'm running a Magento 1.8.0.0 instance that connects & functions successfully with a remote database when specified in app/etc/local.xml as the connection host.

However, when I switch to using 'localhost' as the connection host, it gives me the following error:

Error in file: "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

I'm not trying to create a new installation - the site is practically complete. Deleting the table it says 'already exists' just pulls up the same error, but with a different table referenced. If I delete all 'core_...' tables, it re-creates them, then throws the same error, saying that they exist. I have tried this on Windows and Linux environments.

2 Answers 2

2

Magento tries to rerun the setup scripts.

This happens either, when

  1. core_resource is empty or wrongly filled
  2. when the cache holds wrong module versions

So to solve the problem, reimport the dump to the database and clean the cache, before accessing the site

1
  • Thanks, as it turns out the .sql file I used for import didn't contain data in the 'core_resource' table, so with a better import script it worked correctly. Dec 29, 2014 at 23:16
1

Is the local database from a backup of the remote? The core_resource table is the table that keeps track of the version that magento is up to, when updates are made the appropriate setup scripts will be run based on the data in this table.

If you deleted this table then magento will basically think that it is a clean install and try to reinstall everything. You probably want to restore a fresh backup from the remote first.

Then run select * from core_resource where code = 'core_setup' and see what it gives you, the version should be something over 1.6, if its not there then you might have a problem with the backup

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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