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
Wireshark question
PHP/AJAX: Checking to see if loaded content has changed since last time
Read a word document and send an email using JAVA
Reslution of 1024x768
Outlook 2007
Create multiple SQL Tables at once rather than a single table at a time
SBS2K8 Operating System Requirments
Passing value from one page textbox to another page textbox
In exchange 2007 where is the setting to enable users to send SMTP emails
Need Image uploader that can insert image into wysiwyg ..