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
Desktop icons all gone but now appear as links in taskbar
Problems deleting Spam from SMTP Queye
How to get all child class or classes that implements an abstract class?
Key Press Event
Disable Catch all on Exchange 2007
Proper deletion of wchar memroy in C++
How to get back a User Login when have all user files still but login went away from Users Win 7 Pro
Backup Script
Extracting information from jBASE
how to drop existing connection ?