Question

I am getting following error while trying to reindex catalog_category_flat (Category Flat Data). I did tried to repair the database with PHPMyAdmin and magento database repair tool but still not fix. Can you look into the error and let me know if there is other way to fix the issue?

Stack trace:
#0 /home/cpaneluser/public_html/catalog/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /home/cpaneluser/public_html/catalog/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /home/cpaneluser/public_html/catalog/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /home/cpaneluser/public_html/catalog/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 /home/cpaneluser/public_html/catalog/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('truncate catalo...', Array)
#5 /home/cpaneluser/public_html/catalog/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('truncate catalo...', Array)
#6 /home/cpaneluser/public_htm in /home/cpaneluser/public_html/catalog/lib/Zend/Db/Statement/Pdo.php on line 234
[21-Apr-2014 14:16:35 UTC] PHP Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'cpaneluser_magento.catalog_category_flat' doesn't exist' in /home/cpaneluser/public_html/catalog/lib/Zend/Db/Statement/Pdo.php:228

I got another error while trying to repair magento database.

Error #1005: Can't create table 'thestati_magento.catalog_category_flat_store_1' (errno: -1) on SQL: CREATE TABLE `catalog_category_flat_store_1` ( `entity_id` int(10) unsigned NOT NULL COMMENT 'entity_id', `parent_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'parent_id', `created_at` timestamp NULL DEFAULT NULL COMMENT 'created_at', `updated_at` timestamp NULL DEFAULT NULL COMMENT 'updated_at', `path` varchar(255) NOT NULL DEFAULT '' COMMENT 'path', `position` int(11) NOT NULL COMMENT 'position', `level` int(11) NOT NULL DEFAULT '0' COMMENT 'level', `children_count` int(11) NOT NULL COMMENT 'children_count', `store_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Store Id', `all_children` text COMMENT 'All Children', `available_sort_by` text COMMENT 'Available Product Listing Sort By', `children` text COMMENT 'Children', `custom_apply_to_products` int(11) DEFAULT NULL COMMENT 'Apply To Products', `custom_design` varchar(255) DEFAULT NULL COMMENT 'Custom Design', `custom_design_from` datetime DEFAULT NULL COMMENT 'Active From', `custom_design_to` datetime DEFAULT NULL COMMENT 'Active To', `custom_layout_update` text COMMENT 'Custom Layout Update', `custom_use_parent_settings` int(11) DEFAULT NULL COMMENT 'Use Parent Category Settings', `default_sort_by` varchar(255) DEFAULT NULL COMMENT 'Default Product Listing Sort By', `description` text COMMENT 'Description', `display_mode` varchar(255) DEFAULT NULL COMMENT 'Display Mode', `filter_price_range` decimal(12,4) DEFAULT NULL COMMENT 'Layered Navigation Price Step', `image` varchar(255) DEFAULT NULL COMMENT 'Image', `include_in_menu` int(11) DEFAULT NULL COMMENT 'Include in Navigation Menu', `is_active` int(11) DEFAULT NULL COMMENT 'Is Active', `is_anchor` int(11) DEFAULT NULL COMMENT 'Is Anchor', `landing_page` int(11) DEFAULT NULL COMMENT 'CMS Block', `meta_description` text COMMENT 'Meta Description', `meta_keywords` text COMMENT 'Meta Keywords', `meta_title` varchar(255) DEFAULT NULL COMMENT 'Page Title', `name` varchar(255) DEFAULT NULL COMMENT 'Name', `page_layout` varchar(255) DEFAULT NULL COMMENT 'Page Layout', `path_in_store` text COMMENT 'Path In Store', `thumbnail` varchar(255) DEFAULT NULL COMMENT 'Thumbnail Image', `url_key` varchar(255) DEFAULT NULL COMMENT 'URL Key', `url_path` varchar(255) DEFAULT NULL COMMENT 'Url Path', PRIMARY KEY (`entity_id`), KEY `IDX_CATALOG_CATEGORY_FLAT_STORE_1_STORE_ID` (`store_id`), KEY `IDX_CATALOG_CATEGORY_FLAT_STORE_1_PATH` (`path`), KEY `IDX_CATALOG_CATEGORY_FLAT_STORE_1_LEVEL` (`level`), CONSTRAINT `FK_CAT_CTGR_FLAT_STORE_1_ENTT_ID_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_category_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `FK_CATALOG_CATEGORY_FLAT_STORE_1_STORE_ID_CORE_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Catalog Category Flat (Store 1)'

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top