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

Software

  • Magento 1.5.0.1

Server Environment (dedicated)

  • Lynix
  • Apache
  • PHP
  • MySQL

Problem Description

  • When using  Insert Image function in Magento’s WYSIWYG,  Create Folder function results in the following error:

    SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘colorado_soybu.magento_core_directory_storage’ doesn’t exist

Solution

The issue is caused by a missing “core_directory_storage” table.  To remedy you’ll need to run the following command on your MySQL database (please make sure that you replace “mag_” table prefix with your own):

CREATE TABLE IF NOT EXISTS mag_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 mag_core_directory_storage (`directory_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8