0

A similar question has been asked at:

Magento - Base Table core_file_storage Doesn't exist

However it is referring to the file 'core_file_storage' and mine is referring to 'core_store'. I tried to add a comment to this already existing question but I do not have enough reputation points to do so. I tried to figure out how I could add my question to the existing question but I had no luck. I am sorry if I am doing the wrong thing by creating a new question, but the answers do not solve my problem. Please tell me if there is an official way for me to add to an existing question and I will do it, although my question is slightly different so maybe a fresh question is necessary.

Question: I have very basic knowledge with files and databases. This is my first time experiencing the Error Log file. Basically my website is working fine on my live server, but when I have tried to move it to my local server (MAMP) I am getting an error and my site won't work. I have looked at the Error Log and it says the following:

[14-Apr-2014 16:50:01 UTC] PHP Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘mysite.core_store' doesn't exist' in /home/mysite/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /home/mysite/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /home/mysite/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /home/mysite/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /home/mysite/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 /home/mysite/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `main_ta...', Array)
#5 /home/mysite/lib/Varien/Db in /home/mysite/lib/Zend/Db/Statement/Pdo.php on line 234

This error repeats itself throughout my error log.

My site is running on Magento with a Magento theme. It was working fine before this and I had no problems when moving it to my local server (MAMP). The only changes that I think could have caused this issue, was when I was trying to speed up my site.

I did this by removing images I no longer use from the website folder and also by removing Magento stores that came with the theme I purchased, but I don't use. The fact that the error is for the file 'core_store' it suggests to me that it could be to do with the stores I removed, however the site continued to work on my live server after removing the store. The reason I think it could be to do with the fact I removed images I was no longer using from the folder, is because on the other question, someone has answered saying "the 'core_file_storage' tables are used for storing uploaded images for each product".

I have searched Google trying to get information on what the 'core_store' table does in Magento, but all the results are related to 'core_store' problems, rather than explaining what the 'core_store' is. If anyone could tell me what the 'core_store' table does in Magento, maybe I could help provide more information on the problem.

Thanks

Community
  • 1
  • 1
conor500
  • 109
  • 3
  • 9

2 Answers2

1

I got the same Issue and resolve with below queries :

First, if you do not yet have core_directory_storage, run:

CREATE TABLE `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 NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `parent_id` INT(10) UNSIGNED NULL DEFAULT NULL,
  PRIMARY KEY (`directory_id`),
  UNIQUE INDEX `IDX_DIRECTORY_PATH` (`name`, `path`),
  INDEX `parent_id` (`parent_id`),
  CONSTRAINT `FK_DIRECTORY_PARENT_ID` FOREIGN KEY (`parent_id`) REFERENCES `core_directory_storage` (`directory_id`) ON UPDATE CASCADE ON DELETE CASCADE
) COMMENT='Directory storage' COLLATE='utf8_general_ci' ENGINE=InnoDB ROW_FORMAT=DEFAULT;

Then, run:

CREATE TABLE `core_file_storage` (
  `file_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `content` LONGBLOB NOT NULL,
  `upload_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `filename` VARCHAR(255) NOT NULL DEFAULT '',
  `directory_id` INT(10) UNSIGNED NULL DEFAULT NULL,
  `directory` VARCHAR(255) NULL DEFAULT NULL,
  PRIMARY KEY (`file_id`),
  UNIQUE INDEX `IDX_FILENAME` (`filename`, `directory`),
  INDEX `directory_id` (`directory_id`),
  CONSTRAINT `FK_FILE_DIRECTORY` FOREIGN KEY (`directory_id`) REFERENCES `core_directory_storage` (`directory_id`) ON UPDATE CASCADE ON DELETE CASCADE
) COMMENT='File storage' COLLATE='utf8_general_ci' ENGINE=InnoDB ROW_FORMAT=DEFAULT;
Deepak Mankotia
  • 4,404
  • 6
  • 30
  • 55
0

core_store is a very simple table, and is set up by Magento during the installation process like many other tables. It assigns website/store Id numbers and names to your admin and frontend area(s).

You said you you're trying to move your store to a local server. What often happens in cases like this is that your Magento local.xml file (located in app/etc of your Magento root) needs to be updated to reflect your new database username, password, and table prefix. Magento pulls the information from this file to connect to your database. (as an aside, always make sure this file can't be accessed publicly)

Can you browse your local database to verify that core_store does indeed exist?

Don
  • 333
  • 1
  • 4
  • Thanks for the reply. Yes I have browsed my local database and 'core_store' does exist. I have already made the changes to the local.xml file, these changes are made every time I move my site to my local server. I change the 'username', 'password', and 'dbname'. I have never changed the 'table_prefix' before? So based on the fact we know the 'core_store' table is in the database and the local.xml file has been edited appropriately, can we from here figure out why I am getting this error? Thanks again for the help. – conor500 Jun 06 '14 at 13:28
  • Do you have any other .xml files in `app/etc` besides `config.xml`? Magento globs all the XML files together, so if you have a backup copy of local.xml or something like that, it may be grabbing it and using the wrong settings. – Don Jun 06 '14 at 14:54
  • Thanks again for the reply Don. I checked and no there is only local.xml and config.xml. Do you think it could have anything to do with me removing old images from the websites folder, or deleting the unused stores as mentioned above? – conor500 Jun 06 '14 at 15:27
  • I doubt it, since you said the table itself still exists, and the error message is about it being unable to find the table. If everything in `local.xml` is set up properly with your database, Magento should be able to find the table, so I'm a bit stumped. – Don Jun 06 '14 at 15:32