Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 8
Sample Data 1.0.19870 installation error - Please help
 
pfilias
Jr. Member
 
Avatar
Total Posts:  22
Joined:  2008-05-09
 

I am trying to install the latest sample data on my host and am getting the following error:

MySQL said: Documentation

#1452 - Cannot add or update a child row: a foreign key constraint fails (`efriarshop/catalogindex_eav`, CONSTRAINT `FK_CATALOGINDEX_EAV_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE)

I’ve installed sample data before without a problem. Did something change with version 1.0.19870?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Crucial
Enthusiast
 
Avatar
Total Posts:  770
Joined:  2007-11-07
Phoenix, AZ
 

Could you list the steps you’re doing to install Magento with the sample data? Here’s how I do it:

1. Download and extra the Magento and sample data files.
2. Set the appropriate permissions.
3. Import the SQL file into a clean database.
4. Run the PEAR updater.
5. Go to the web-based installer.

Or, an easier way if you have SSH, is to do this:

wget http://www.magentocommerce.com/downloads/assets/1.0.19870/magento-1.0.19870.4.tar.gz
wget http://www.magentocommerce.com/downloads/assets/1.0.19870/magento-sample-data-1.0.19870.tar.gz
tar -zxvf magento-1.0.19870.4.tar.gz
tar -zxvf magento-sample-data-1.0.19870.tar.gz
mv magento-sample-data-1.0.19870/media/* magento/media/
mv magento-sample-data-1.0.19870/magento_sample_data_for_1.0.19870.sql magento/data.sql
cd magento
chmod o+w var var/.htaccess app/etc
chmod -R o+w media
mysql -u DBUSER -pDBPASS DBNAME < data.sql
./pear mage-setup .
./pear install -f magento-core/Mage_All_Latest
rm -rf downloader/pearlib/cache/* downloader/pearlib/download/* .htaccess.sample data.sql index.php.sample ../magento-1.0.19870.4.tar.gz ../magento-sample-data-1.0.19870/ ../magento-sample-data-1.0.19870.tar.gz
find . -type d -exec chmod 777 {} \;

Replace the underlined DB values of course.

That will install the latest version of Magento in a directory called magento. It will also install the sample data and setup Magento Connect (PEAR downloader) so you can use that later to upgrade or get extensions.

 
Magento Community Magento Community
Magento Community
Magento Community
 
pfilias
Jr. Member
 
Avatar
Total Posts:  22
Joined:  2008-05-09
 

I am not doing this via SSH.

1) Download Magento 1.0.19870 and the coinciding Sample Data for 1.0.19870.
2) Create clean db for Magento installtion
3a) Upload files
3b) Try to run the sample-data.sql file (or whatever it’s called) via phpMyAdmin and I get that error.

As far as your method: I’ll try to work with my host to allow for me to have enough access via SSH to do all that. I don’t want to install the store in a directory called Magento though. I’d like to have it in the root of wherever I am hosting it. No biggie, right?

Also, would the failure to have all the files uploaded and permissions changed actually cause the SQL import to fail like it is?

 
Magento Community Magento Community
Magento Community
Magento Community
 
adimagento
Guru
 
Avatar
Total Posts:  626
Joined:  2007-08-29
Los Angeles, CA
 

Please try to upload this file instead:

File Attachments
magento_sample_data_for_1.0.19870.sql  (File Size: 805KB - Downloads: 3963)
 
Magento Community Magento Community
Magento Community
Magento Community
 
pfilias
Jr. Member
 
Avatar
Total Posts:  22
Joined:  2008-05-09
 

Is there something different with that .sql file?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Crucial
Enthusiast
 
Avatar
Total Posts:  770
Joined:  2007-11-07
Phoenix, AZ
 
pfilias - 16 July 2008 04:39 PM

Is there something different with that .sql file?

I compared it with the sample data from the latest release, and it’s different by a few bytes. What exactly, I’m not sure, I didn’t open them up to examine. Most likely code that drops constraints or something.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Harry7
Jr. Member
 
Total Posts:  1
Joined:  2008-07-27
 

I’m getting the same phpMyAdmin error #1452 - Cannot add or update a child row: a foreign key constraint fails

on a new install using magento_sample_data_for_1.0.19870.sql

All the create TABLE code runs but stops at the first INSERT

What is a “foreign key constraint” failure?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Zsolt
Jr. Member
 
Total Posts:  1
Joined:  2008-05-16
 

same thing here:
#1452 - Cannot add or update a child row: a foreign key constraint fails (`turzaizsolt_magento/catalogindex_eav`, CONSTRAINT `FK_CATALOGINDEX_EAV_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE)

 
Magento Community Magento Community
Magento Community
Magento Community
 
adimagento
Guru
 
Avatar
Total Posts:  626
Joined:  2007-08-29
Los Angeles, CA
 

Are you guys getting this error with the new sql file provided above or with the one you got from the download page?

This file is different from the regular one, it has changes that appeared sometimes while using phpMyAdmin only.  We will post it on the wiki as well.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ericscott
Member
 
Total Posts:  57
Joined:  2008-05-14
 
adimagento - 08 July 2008 07:12 PM

Please try to upload this file instead:

OMG thank you so much for this! you have no idea how many times i kept dropping all my tables and rerunning the SQL, thinking that i imported wrong somehow.

 
Magento Community Magento Community
Magento Community
Magento Community
 
MagKen
Jr. Member
 
Total Posts:  13
Joined:  2008-04-10
 
pfilias - 08 July 2008 05:50 PM

I am trying to install the latest sample data on my host and am getting the following error:

MySQL said: Documentation

#1452 - Cannot add or update a child row: a foreign key constraint fails (`efriarshop/catalogindex_eav`, CONSTRAINT `FK_CATALOGINDEX_EAV_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE)

I’ve installed sample data before without a problem. Did something change with version 1.0.19870?

Same here with the most recent 1.1.2 version and the updated sample data file supplied by Adi above. I am on OS X running MAMP.

The tables create fine but I run into problems when trying to insert the data through the phpmyAdmin interface.

 
Magento Community Magento Community
Magento Community
Magento Community
 
dexter
Jr. Member
 
Total Posts:  8
Joined:  2008-08-06
 

Installation Error
Demo site home page displays - Clicking on any product produces an error using the front end.

Using version 1.1.2 on a localhost WampServer with sample data pack 1.0.19870.zip as posted in the download section.  Imported data from sample pack into a magento DB produced no errors using PHPMyAdmin.  Media files added as per instructions for sample images.

The following message is displayed when clicking on the home page under ‘best selling products’ and then ‘Sony VAIO’ image.

_________________________

There has been an error processing your request

Note:
This is the URL as posted in the browser.
http://localhost/magento/report/?id=-744527314&s;=default

Warning: include(Mage\Catalog\Model\Resource\Eav\Mysql4\Product\Attribute\Backend\Tierprice.php[function.include]failed to open streamNo such file or directory  in C:\wamp\www\magento\app\code\core\Mage\Core\functions.php on line 67
Trace
:
#0 C:\wamp\www\magento\app\code\core\Mage\Eav\Model\Entity\Abstract.php(1249): Mage_Eav_Model_Entity_Abstract->walkAttributes('backend/afterLo...', Array)
#1 C:\wamp\www\magento\app\code\core\Mage\Eav\Model\Entity\Abstract.php(797): Mage_Eav_Model_Entity_Abstract->_afterLoad(Object(Mage_Catalog_Model_Product))
#2 C:\wamp\www\magento\app\code\core\Mage\Core\Model\Abstract.php(201): Mage_Eav_Model_Entity_Abstract->load(Object(Mage_Catalog_Model_Product), 27, NULL)
#3 C:\wamp\www\magento\app\code\core\Mage\Catalog\controllers\ProductController.php(45): Mage_Core_Model_Abstract->load(27)
#4 C:\wamp\www\magento\app\code\core\Mage\Catalog\controllers\ProductController.php(113): Mage_Catalog_ProductController->_initProduct()
#5 C:\wamp\www\magento\app\code\core\Mage\Core\Controller\Varien\Action.php(343): Mage_Catalog_ProductController->viewAction()
#6 C:\wamp\www\magento\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(144): Mage_Core_Controller_Varien_Action->dispatch('view')
#7 C:\wamp\www\magento\app\code\core\Mage\Core\Controller\Varien\Front.php(168): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#8 C:\wamp\www\magento\app\Mage.php(420): Mage_Core_Controller_Varien_Front->dispatch()
#9 C:\wamp\www\magento\index.php(46): Mage::run()
#10 {main}

Suggestions as to what needs to be changed, modified, etc would be appreciated.

__________________________

Update…

C:\wamp\www\magento\app\code\core\Mage\Core\functions.php on line 67

Noticed that line 67 is

include($classFile);
and that it can not be found thus it breaks the include.

Suggestions?

 
Magento Community Magento Community
Magento Community
Magento Community
 
laduda
Jr. Member
 
Total Posts:  6
Joined:  2007-09-19
 

MySQL - 5.0.27
phpMyAdmin - 2.8.2.4

magento_sample_data_for_1.1.2.sql

Error

consulta SQL:

CREATE TABLE `catalog_category_entity_datetime` (
`value_id` int( 11 ) NOT NULL AUTO_INCREMENT ,
`entity_type_id` smallint( 5 ) unsigned NOT NULL default ‘0’,
`attribute_id` smallint( 5 ) unsigned NOT NULL default ‘0’,
`store_id` smallint( 5 ) unsigned NOT NULL default ‘0’,
`entity_id` int( 10 ) unsigned NOT NULL default ‘0’,
`value` datetime NOT NULL default ‘0000-00-00 00:00:00’,
PRIMARY KEY ( `value_id` ) ,
UNIQUE KEY `IDX_BASE` ( `entity_type_id` , `entity_id` , `attribute_id` , `store_id` ) ,
KEY `FK_ATTRIBUTE_DATETIME_ENTITY` ( `entity_id` ) ,
KEY `FK_CATALOG_CATEGORY_ENTITY_DATETIME_ATTRIBUTE` ( `attribute_id` ) ,
KEY `FK_CATALOG_CATEGORY_ENTITY_DATETIME_STORE` ( `store_id` ) ,
CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_DATETIME_ATTRIBUTE` FOREIGN KEY ( `attribute_id` ) REFERENCES `eav_attribute` ( `attribute_id` ) ON DELETE CASCADE ON UPDATE CASCADE ,
CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_DATETIME_ENTITY` FOREIGN KEY ( `entity_id` ) REFERENCES `catalog_category_entity` ( `entity_id` ) ON DELETE CASCADE ON UPDATE CASCADE ,
CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_DATETIME_STORE` FOREIGN KEY ( `store_id` ) REFERENCES `core_store` ( `store_id` ) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = InnoDB DEFAULT CHARSET = utf8;

MySQL ha dicho: Documentación
#1005 - Can’t create table ‘./chico_magento/catalog_category_entity_datetime.frm’ (errno: 150)

 
Magento Community Magento Community
Magento Community
Magento Community
 
Nijhof Internet Media
Member
 
Avatar
Total Posts:  32
Joined:  2008-07-04
Netherlands
 

Same problem here:
I have the same error on importing
magento_sample_data_for_1.1.2.sql
on a clean database
MySQL 5.0.58
phpMyAdmin 2.8.2.4

Fout
SQL
-query:

CREATE TABLE  `catalog_category_entity_datetime` (
 `
value_idINT11 NOT NULL AUTO_INCREMENT ,
 `
entity_type_idSMALLINTUNSIGNED NOT NULL DEFAULT  '0',
 `
attribute_idSMALLINTUNSIGNED NOT NULL DEFAULT  '0',
 `
store_idSMALLINTUNSIGNED NOT NULL DEFAULT  '0',
 `
entity_idINT10 UNSIGNED NOT NULL DEFAULT  '0',
 `
valueDATETIME NOT NULL DEFAULT  '0000-00-00 00:00:00',
PRIMARY KEY (  `value_id` ) ,
UNIQUE KEY  `IDX_BASE` (  `entity_type_id` ,  `entity_id` ,  `attribute_id` ,  `store_id` ) ,
KEY  `FK_ATTRIBUTE_DATETIME_ENTITY` (  `entity_id` ) ,
KEY  `FK_CATALOG_CATEGORY_ENTITY_DATETIME_ATTRIBUTE` (  `attribute_id` ) ,
KEY  `FK_CATALOG_CATEGORY_ENTITY_DATETIME_STORE` (  `store_id` ) ,
CONSTRAINT  `FK_CATALOG_CATEGORY_ENTITY_DATETIME_ATTRIBUTEFOREIGN KEY (  `attribute_id` ) REFERENCES  `eav_attribute` (  `attribute_id` ) ON DELETE CASCADE ON UPDATE CASCADE ,
CONSTRAINT  `FK_CATALOG_CATEGORY_ENTITY_DATETIME_ENTITYFOREIGN KEY (  `entity_id` ) REFERENCES  `catalog_category_entity` (  `entity_id` ) ON DELETE CASCADE ON UPDATE CASCADE ,
CONSTRAINT  `FK_CATALOG_CATEGORY_ENTITY_DATETIME_STOREFOREIGN KEY (  `store_id` ) REFERENCES  `core_store` (  `store_id` ) ON DELETE CASCADE ON UPDATE CASCADE
ENGINE INNODB DEFAULT CHARSET utf8;


MySQL retourneerde

#1005 - Can't create table './db_magento/catalog_category_entity_datetime.frm' (errno: 150)

importing
magento_sample_data_for_1.0.19870.sql
is without problems.

 
Magento Community Magento Community
Magento Community
Magento Community
 
dexter
Jr. Member
 
Total Posts:  8
Joined:  2008-08-06
 

New Sample Data Set Does Not Work With Version Magento 1.1.3

This is the path when ‘Anashria’ is selected on the home page.  (see Anashria PNG) And it will display the woops message. (see Woops PNG)
http://localhost/magento/apparel/shoes/womens/anashria-womens-premier-leather-sandal.html

When looking at the Megento files, there is no apparel or shoes or womens file folder.  These were not included in the ‘media’ files provided as part of the sample data 1.1.3 file.  Are these missing?  Or is the path not correct and they can not be located.

This URL displays the Living Room page.
http://localhost/magento/catalog/category/view/s/living-room/id/22/

Did try this demo product:
Furniture > Living Room > Ottoman

When selecting the above Ottoman path the below is the displayed URL.  This shows an error message. (Function: Include Failed to Open Stream - function.php line 67)
http://localhost/magento/report/?id=-815201448&s;=default

Same error if ‘Add to Cart’ is chosen for Ottoman.

Using WampServer 2.0a
Windows XP
Magento 1.1.3
Sample Data 1.1.2

Please any suggestions on getting the sample data set to work on localhost?

Image Attachments
anashria.pngwoops.png
 
Magento Community Magento Community
Magento Community
Magento Community
 
Nijhof Internet Media
Member
 
Avatar
Total Posts:  32
Joined:  2008-07-04
Netherlands
 

SOLUTION for error #1005 on importing magento_sample_data_for_1.1.2.sql

MySQL 5.0.58
phpMyAdmin 2.8.2.4

This is a solution for the error:  #1005 - Can’t create table ‘./db_magento/catalog_category_entity_datetime.frm’ (errno: 150).
After research it seemed that the SET FOREIGN_KEYS_CHECKS=0 command was ignored.
This command is in the inline comments part of the sql file (top of the script):

/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;

The /* is the comment character and the ! tells mysql to execute the code within the comment. The number 40014 is a version number.
For some reason the code is not executed due to the inline comment.
Removing the version number did not solve it.
WORKING SOLUTION:
Remove the inline comment or replace line with:

SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;

SQL file will import successfully.

UPDATE:
Apart from solution above:
I also noticed that some tables are MyISAM, change everything to InnoDB

UPDATE2:
REMOVE ALL INLINE COMMENTS, PRESERVE THE CODE WITHIN THE COMMENTS
for some reason ALL code in inline comments is not executed causing an install failure of the shop

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 8