Magento – SQLSTATE[42S02]: Base table or view not found: 1146

databaseerrormagento-1.9

Last night my host experienced what they call "InnoDB engine server is broken". It took awhile but they did a recovery but had some issues with missing tables. I also found out that we didn't have any backups. I had switched from cloud to dedicated and found out (after the fact) that the auto backup wasn't included and that I had to order separately.

I do have a problem with a missing table on http://bit.ly/1STElBF

I looked up some solutions, but I'm not sure if they apply to me. My host seems to think they don't but I was hoping someone could help me with this?

The error message:

SQLSTATE[42S02]: Base table or view not found: 1146 Table
'firstgea_shop.core_store' doesn't exist, query was: SELECT `main_table`.*
FROM `core_store` AS `main_table` ORDER BY CASE WHEN main_table.store_id = 0 THEN 0 ELSE 1 END ASC, main_table.sort_order ASC, main_table.name ASC

Trace:

#0 /home/firstgea/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/firstgea/public_html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /home/firstgea/public_html/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /home/firstgea/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `main_ta...', Array)
#4 /home/firstgea/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `main_ta...', Array)
#5 /home/firstgea/public_html/lib/Zend/Db/Adapter/Abstract.php(737): Varien_Db_Adapter_Pdo_Mysql->query('SELECT `main_ta...', Array)
#6 /home/firstgea/public_html/lib/Varien/Data/Collection/Db.php(736): Zend_Db_Adapter_Abstract->fetchAll('SELECT `main_ta...', Array)
#7 /home/firstgea/public_html/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(521): Varien_Data_Collection_Db->_fetchAll('SELECT `main_ta...', Array)
#8 /home/firstgea/public_html/lib/Varien/Data/Collection/Db.php(572): Mage_Core_Model_Resource_Db_Collection_Abstract->getData()
#9 /home/firstgea/public_html/app/code/core/Mage/Core/Model/Resource/Store/Collection.php(174): Varien_Data_Collection_Db->load(false, false)
#10 /home/firstgea/public_html/lib/Varien/Data/Collection.php(752): Mage_Core_Model_Resource_Store_Collection->load()
#11 /home/firstgea/public_html/app/code/core/Mage/Core/Model/App.php(635): Varien_Data_Collection->count()
#12 /home/firstgea/public_html/app/code/core/Mage/Core/Model/App.php(477): Mage_Core_Model_App->_initStores()
#13 /home/firstgea/public_html/app/code/core/Mage/Core/Model/App.php(360): Mage_Core_Model_App->_initCurrentStore('', 'store')
#14 /home/firstgea/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#15 /home/firstgea/public_html/index.php(84): Mage::run('', 'store')
#16 {main}

Best Answer

First of all - create backup of all database that you have right now.

Looks like you haven't basic table. Without this table Magento can't work at all.

If you have other tables, only this one missing - you can try to install Magento to OTHER database and copy this table with mysqldump & mysql .

If websites data is not important for you (as example if it's new website, or test website) - you can just re-install Magento.

Anyway, best of all - to perform any actions only by Magento developer.

Related Topic