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

General error: 1005 Can’t create table magento
 
redpen
Sr. Member
 
Total Posts:  254
Joined:  2008-01-23
 

Struggling with my 1.1.1 update.  Can anyone help, please?

Getting this on every single page!

PDOException Object
(
[message:protected] => SQLSTATE[HY000]: General error: 1005 Can’t create table ‘./XXXX_magento/#sql-1866_d22b.frm’ (errno: 150)
[string:private] =>
[code:protected] => HY000
[file:protected] => /home/XXXX/public_html/XXXX/lib/Varien/Db/Adapter/Pdo/Mysql.php
[line:protected] => 150
[trace:private] => Array
(
[0] => Array
(
[file] => /home/XXXX/public_html/XXXX/lib/Varien/Db/Adapter/Pdo/Mysql.php
[line] => 150
[function] => query
[class] => PDO
[type] => ->
[args] => Array
(
[0] => ALTER TABLE `sales_flat_quote_item` ADD CONSTRAINT `FK_SALES_QUOTE_ITEM_CATALOG_PRODUCT_ENTITY`FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
)

)

[1] => Array
(
[file] => /home/powXXXXerh/public_html/XXXX/lib/Varien/Db/Adapter/Pdo/Mysql.php
[line] => 326
[function] => raw_query
[class] => Varien_Db_Adapter_Pdo_Mysql
[type] => ->
[args] => Array
(
[0] => ALTER TABLE `sales_flat_quote_item` ADD CONSTRAINT `FK_SALES_QUOTE_ITEM_CATALOG_PRODUCT_ENTITY`FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
)

)

Goes on like that for a while…

 
Magento Community Magento Community
Magento Community
Magento Community
 
Lenny2
Sr. Member
 
Total Posts:  171
Joined:  2008-05-21
München
 

Same problem here!

 
Magento Community Magento Community
Magento Community
Magento Community
 
redpen
Sr. Member
 
Total Posts:  254
Joined:  2008-01-23
 

See here: http://www.magentocommerce.com/boards/viewthread/13077/ for solution.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gabrusch
Member
 
Avatar
Total Posts:  44
Joined:  2008-03-26
Wuerzburg, Germany
 

Did you ever solve this problem? I still have it

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gabrusch
Member
 
Avatar
Total Posts:  44
Joined:  2008-03-26
Wuerzburg, Germany
 

FIXED: Using the SQL commands in this post

http://www.magentocommerce.com/boards/viewthread/13077/P15/

Don’t forget you’ll have to update your theme as described in here:
http://www.magentocommerce.com/wiki/upgrading_magento_themes_for_the_latest_releases

 
Magento Community Magento Community
Magento Community
Magento Community
 
Zerkella
Jr. Member
 
Avatar
Total Posts:  10
Joined:  2010-06-22
Kiev
 

This error usually arises due to foreign keys duplication - in mysql there cannot be identically named foreign keys in one DB.

Make sure that you’re not creating tables (installing new Magento) in same DB as previous one. Even using prefixes for tables.

 
Magento Community Magento Community
Magento Community
Magento Community
 
floordesign
Jr. Member
 
Total Posts:  17
Joined:  2010-05-18
 

After spending 4-5 hours trying to install magento 1.4.1.1 on shared hosting, I’ve finally installed it.
I’ve tried all solutions posted in this forum but with no success (with new database, with and without sample data, modifying the mysql4-1… php files or even delete them etc.). I think there are problems with hosting providers (settings in php or web servers).

I’ve installed magento on my computer with WAMP server and I moved this installation on my shared hosting.

Here are the steps which I did for having a fresh install on shared hosting:

1. Download magento latest version and WAMP server

2. Install WAMP sever and modify the following settings:
- C:\wamp\bin\apache\Apache2.2.11\conf\httpd.conf - uncomment LoadModule rewrite_module modules/mod_rewrite.so line.
- C:\wamp\bin\apache\Apache2.2.11\bin\php.ini - modify max_execution_time = 5000 and max_input_time = 5000
- C:\wamp\bin\php\php5.3.0\php.ini - modify max_execution_time = 5000 and max_input_time = 5000
- C:\wamp\bin\apache\Apache2.2.11\bin\php.ini - uncomment the line:  extension=php_curl.dll
- C:\wamp\bin\php\php5.3.0\php.ini - uncomment the line:  extension=php_curl.dll
- restart WAMP services or close WAMP server and start the server

3. Install Magento on local server
- unzip the magento installation file in WAMP’s www folder
- move all files from www\magento\ in www\ (because I wanted to have installation in root)
- from phpmyadmin I’ve created a database (ex. magento)
- run magento install from http://localhost
- in database settings chage database name, leave user root and no password
- I’ve completed the installation without any errors (the first time I’ve got errors from maximum execution time because it was 30 sec., but after modifying the server settings there were no problems).

4. Moving Magento installation on shared hosting
- you can use FTP or CPanel file explorer (compress all magento files, upload the archive and uncompress there) to upload all files on remote server

5. Moving Magento database
- from WAMP phpmyadmin export the database in SQL file
- from remote sever (shared hosting) phpmyadmin create a new database and assign a user with all rights, and import the SQL file
- edit /app/etc/local.xml and change <username><![CDATA[your_username]]></username>, <password><![CDATA[your_password]]></password>, <dbname><![CDATA[your_db_name]]></dbname>
- from remote server phpmyadmin edit core_config_data table and chage all url entries (I’ve edited 10 entries) with your site url (ex. web/unsecure/base_url -> http://www.yourdomain.com/ web/unsecure/base_skin_url -> http://www.yourdomain.com/skin/ etc. )
6. That’s all. You should see your magento site now.

 
Magento Community Magento Community
Magento Community
Magento Community
 
gari marcos
Jr. Member
 
Avatar
Total Posts:  21
Joined:  2008-10-24
 

Good Enought for those who solved the problem. But not form me.
The Bug/Error came to me when I Decided to move my magento to a new server.
I have a magento 1.3.2.3 running perfectly online, but Im trying to move it and update it on a new server.
The instalation on the new server of the version 1.3.2.3 was just perfect. I also imported my old Database and can see my store just as it is on the old server. so… tranfer just PERFECT.
The problem comes when I upgrade with the MAGE_ALL_LATEST from Magento Connect. The update is ok (no problems shown on the update display). But when trying to access to my new server adress on firefox and the page shows the ERROR:

PDOException Object
(
[message:protected] => SQLSTATE[HY000]: General error: 1005 Can’t create table ‘./lightdes_magento/catalog_product_index_tier_price.frm’ (errno: 150)
[string:private] =>
[code:protected] => HY000
[file:protected] => /home/lightdes/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php
[line:protected] => 276
[trace:private] => Array
(
[0] => Array
(
[file] => /home/lightdes/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php
[line] => 276
[function] => query
[class] => PDO
[type] => ->
[args] => Array
(
[0] => CREATE TABLE IF NOT EXISTS `catalog_product_index_tier_price` (
`entity_id` INT(10) UNSIGNED NOT NULL,
`customer_group_id` SMALLINT(5) UNSIGNED NOT NULL,
`website_id` SMALLINT(5) UNSIGNED NOT NULL,
`min_price` DECIMAL(12,4) DEFAULT NULL,
PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_TIER_PRICE_ENTITY` FOREIGN KEY (`entity_id`)
REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_TIER_PRICE_CUSTOMER` FOREIGN KEY (`customer_group_id`)
REFERENCES `customer_group` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_TIER_PRICE_WEBSITE` FOREIGN KEY (`website_id`)
REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=INNODB DEFAULT CHARSET=utf8

.... and so till Array 11.
Im stuck there, trying several solutions that worked for other but not for me :’(
Any help is much appreciated. It’s a bug?
Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mattdev_nz
Jr. Member
 
Avatar
Total Posts:  27
Joined:  2010-06-21
New Zealand
 

@gari
Try my steps in this post / thread: http://www.magentocommerce.com/boards/viewthread/76807/#t293823

Let me know how you got on
Matt.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top