Magento Forum

   
Page 1 of 2
Sample Data 1.1.2 MySQL Error
 
Nijhof Internet Media
Member
 
Avatar
Total Posts:  32
Joined:  2008-07-04
Netherlands
 

Bij het importeren van het sql bestand van de sample data 1.1.2 (magento_sample_data_for_1.1.2.sql) geeft mysql een foutmelding:

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)

anderen met hetzelfde probleem cq. oplossing?

 
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/sample data

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gui
Guru
 
Avatar
Total Posts:  588
Joined:  2008-03-09
 

Top, dank je, voor het plaatsen van de gevonden oplossing; dat zouden meer mensen moeten doen!

 
Magento Community Magento Community
Magento Community
Magento Community
 
ChristopherTate
Jr. Member
 
Total Posts:  13
Joined:  2008-04-20
 

Does anyone have a copy of this file without the comments?  I’ve tried removing the comments but there are a lot and it is still failing.

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

Attached is an edited version of the 1.1.2 sample data sql file.
All inline comments are removed, code is preserved.

MySQL 5.0.58
phpMyAdmin 2.8.2.4

First, create database and import sql file.
Then install Magento (first upload sample data!).
I’ve installed Magento 1.1.3 (downloader), this is working with the sample data.
Don’t forget to clear the cache of Magento (System).

File Attachments
magento_sample_data_for_1.1.2_edited_nc.sql  (File Size: 1304KB - Downloads: 1447)
 
Magento Community Magento Community
Magento Community
Magento Community
 
BerArt
Moderator
 
Avatar
Total Posts:  122
Joined:  2008-04-02
The Netherlands - Breda
 

Thx! Henrikus smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
laughingbuddha
Jr. Member
 
Avatar
Total Posts:  8
Joined:  2007-10-05
Southampton, UK
 

Works a treat. Now why can’t they have this as standard smile

One very embarrassing meeting/training session with a client, and 4 hours later and i find this fix.

Works a treat, your a star. Cheers smile

Matt

 
Magento Community Magento Community
Magento Community
Magento Community
 
sourcez
Jr. Member
 
Total Posts:  3
Joined:  2008-10-06
 

Worked great for me too, I agree with laughingbuddha - why not as standard?

 
Magento Community Magento Community
Magento Community
Magento Community
 
winlux
Jr. Member
 
Total Posts:  5
Joined:  2009-02-22
Jenaz (Switzerland)
 

I got the same problem with sample data for 1.2.0 and could fix it the same way. Here is the corrected SQL-File.

Regards
Peter

File Attachments
magento_sample_data_for_1.2.0_corrected.sql  (File Size: 944KB - Downloads: 1231)
 
Magento Community Magento Community
Magento Community
Magento Community
 
xitch
Member
 
Total Posts:  54
Joined:  2008-10-21
 

This is great thanks!!!  Why can’t they just give us this file in the first place????  I don’t get it. 

Thanks so much for making a non-techy person able to fix this problem :D

 
Magento Community Magento Community
Magento Community
Magento Community
 
Oesterbye
Jr. Member
 
Total Posts:  3
Joined:  2009-03-02
 

Thx Winlux

It is appreciated

 
Magento Community Magento Community
Magento Community
Magento Community
 
Daniel Chohfi
Jr. Member
 
Total Posts:  1
Joined:  2009-04-03
 

It works for me too! Thanks a lot!!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
scarlet
Jr. Member
 
Total Posts:  2
Joined:  2009-04-14
 

thank you so much !  you are so cool!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Danroy
Jr. Member
 
Total Posts:  5
Joined:  2007-11-19
 

Worked for me too smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dovid Yudkowitz
Jr. Member
 
Total Posts:  16
Joined:  2009-04-23
 

Amazing! I also don’t get why they don’t give this out in the first place...Maybe they are unaware of the problem.

 
Magento Community Magento Community
Magento Community
Magento Community
 
8bit industries
Jr. Member
 
Total Posts:  1
Joined:  2009-04-05
 

sorry I still get this error

Error
SQL query:

--
-- Table structure for table `admin_assert`
--
DROP TABLE IF EXISTS `admin_assert` ;

MySQL said:

#1046 - No database selected

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