Error - Magento 1: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'example_magento.core_directory_storage' doesn't exist. Print

  • 109

After upgrading to Magento 1.5, you may get the following error when trying to upload an image using the built-in WYSIWYG interface:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'example_magento.core_directory_storage' doesn't exist.

To fix this you need to create the table.

1) Backup your database
2) Using phpMyAdmin or other SQL Manager, run the following SQL update commands:

SET FOREIGN_KEY_CHECKS = 0;

CREATE TABLE IF NOT EXISTS `core_directory_storage` (
`directory_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`path` varchar(255) NOT NULL DEFAULT '',
`upload_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
`parent_id` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`directory_id`),
UNIQUE KEY `IDX_DIRECTORY_PATH` (`name`, `path`),
KEY `parent_id` (`parent_id`),
CONSTRAINT `FK_DIRECTORY_PARENT_ID` FOREIGN KEY (`parent_id`)
REFERENCES `core_directory_storage` (`directory_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Directory storage';

SET FOREIGN_KEY_CHECKS = 1;

If you are a Create Hosting customer on the Magento Hosting Plan, feel free to submit a support ticket and we can take care of this issue for you.


Was this answer helpful?

« Back