1

Here's a weird one. I need to set up a dev server, so I'm importing a DB from and existing production EE install. The import proceeds fine until it gets to the exp_stash table. Then I get MySQL error 150. I've tried this on two different servers, but I get the same error.

CREATE TABLE  `exp_stash` (
`id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
`site_id` INT( 4 ) UNSIGNED NOT NULL DEFAULT  '1',
`session_id` VARCHAR( 40 ) DEFAULT NULL ,
`bundle_id` INT( 11 ) UNSIGNED NOT NULL DEFAULT  '1',
`key_name` VARCHAR( 64 ) NOT NULL ,
`key_label` VARCHAR( 64 ) DEFAULT NULL ,
`created` INT( 10 ) UNSIGNED NOT NULL ,
`expire` INT( 10 ) UNSIGNED NOT NULL DEFAULT  '0',
`parameters` TEXT,
PRIMARY KEY (  `id` ) ,
KEY  `bundle_id` (  `bundle_id` ) ,
KEY  `key_session` (  `key_name` ,  `session_id` ) ,
KEY  `key_name` (  `key_name` ) ,
KEY  `site_id` (  `site_id` ) ,
CONSTRAINT  `exp_stash_fk` FOREIGN KEY (  `bundle_id` ) REFERENCES    
`exp_stash_bundles` (  `id` ) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = INNODB DEFAULT CHARSET = utf8 ROW_FORMAT = COMPACT;

The error is

#1005 - Can't create table 'versastu_oakcrk.exp_stash' (errno: 150) 

Research shows it has something to do with InnoDB table type/db type, but solution is unknown.

2

For this particular quandary, this worked:

Add this line to the top of the SQL file:

SET FOREIGN_KEY_CHECKS = 0;  

Source: http://devot-ee.com/add-ons/support/stash/viewthread/5700

If you see this problem and the above solution doesn't work, check this thread as well: http://devot-ee.com/add-ons/support/stash/viewthread/10311

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.