Microsoft
Software
Hardware
Network
Question : mySQL problem
Hi Experts,
I am having a tough time trying to restore some tables in a mySQL DB using MyPhpAdmin.
It appears that the SQL generated by the export or backup abc.sql file insists that tables be created with foreign key constraints and/or references to tables that don't exist because the are created after the one that throws the error. The .sql file sequence seems to be out of order given the FK constraints (i.e. contact table is created later in the script). How do the experts handle it when the .sql file to be imported seems to be sequentially wrong? (it's 6000 lines)
Thanks, HNM
Here is the error message and an example of a table that causes the situation.
MySQL said:
#1005 - Can't create table './xyz123/civicrm_acl_cach
e.frm' (errno: 150)
SQL query:
CREATE TABLE `civicrm_acl_cache` (
`id` int( 10 ) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique table ID',
`contact_id` int( 10 ) unsigned default NULL COMMENT 'Foreign Key to Contact',
`acl_id` int( 10 ) unsigned NOT NULL COMMENT 'Foreign Key to ACL',
`modified_date` date default NULL COMMENT 'When was this cache entry last modified',
PRIMARY KEY ( `id` ) ,
KEY `index_acl_id` ( `acl_id` ) ,
KEY `FK_civicrm_acl_cache_cont
act_id` ( `contact_id` ) ,
CONSTRAINT `FK_civicrm_acl_cache_acl_
id` FOREIGN KEY ( `acl_id` ) REFERENCES `civicrm_acl` ( `id` ) ON DELETE CASCADE ,
CONSTRAINT `FK_civicrm_acl_cache_cont
act_id` FOREIGN KEY ( `contact_id` ) REFERENCES `civicrm_contact` ( `id` ) ON DELETE CASCADE ) ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci
Answer : mySQL problem
Hi HNM,
Did you try adding it to the script, ie at line 1 of your import script to be sure that setting was applied to the same running connection?
Cheers,
Sean
Random Solutions
VFP and API
Black Screen on Windows Server 2008 R2
Montage, xargs and a sorted ls
Last full week in sql
javascript starts with
The Action Cannot Be Completed. The connection to Micrsoft Exchange is unavailable.
Form Visiable property
Is this Session Login Secure? and if not how to improve it?
Windows Server 2003 FTP w/ IIS6
HP Media Center M376N Desktop Computer needs CPU Fan