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
Is there a way to Setup my AS400 Session so that I automatically logs me on without having to type username/password?
Desctription and title in Google results different
Does anyone have experience with Microsoft Azure SQL services?
CrossTab Crystal Total Page No Different than actual Number of pages
Oracle Query Tuning
Deploying printers group policy server 2003 and server 2008
vb6 scrollbar overflow error
SQL QUestion
SSIS ETL package to update/insert staging source to destination ?
Crystal REports - Filter not working