Reputation: 45
I already try to upload my large sql file, but some error will be shown. please see my attached error photo. my sql database size 750MB and this is magento database. how can i do now? please help me............
Error at the line 391: ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Api Sessions';
Query:
CREATE TABLE `api_session` (
`user_id` int(10) unsigned NOT NULL COMMENT 'User id',
`logdate` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Login date',
`sessid` varchar(40) DEFAULT NULL COMMENT 'Sessioin id',
KEY `IDX_API_SESSION_USER_ID` (`user_id`),
KEY `IDX_API_SESSION_SESSID` (`sessid`),
CONSTRAINT `FK_API_SESSION_USER_ID_API_USER_USER_ID` FOREIGN KEY (`user_id`) REFERENCES `api_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Api Sessions'`
MySQL: Cannot add foreign key constraint
Upvotes: 0
Views: 577
Reputation: 45
write SET FOREIGN_KEY_CHECKS=0; initially and SET FOREIGN_KEY_CHECKS=1; at the end of db file. or export db again with disabling foreign key check settings
Upvotes: 1