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
message box
Exchange 2003 to Exchange 2010 migration - Calendar EntryID values
Sql query returns 24 hour time format instead of 12 hour am/pm format:
Can I create a Region in SQL Server similar to C#
Splash screen that takes focus with main page fuzzed out in the background
Access 2003 - ODBC --Call failed,
Update FoxPro Tables
ssh / sftp without password prompt
regex move command in Ubuntu, how would I move the following files to a directory?
Robocopy correct syntax for copying user profiles