CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • SQL error when trying to backup a database
Pages: [1]

Author Topic: SQL error when trying to backup a database  (Read 1207 times)

c-c-m

  • Guest
SQL error when trying to backup a database
April 13, 2010, 02:35:03 am
Hello

I want to copy a database from one site to my local server and whenever I try to import the database with phpmyadmin or using bigdump I get the same error:

Code: [Select]
Error at the line 9964: ADD CONSTRAINT `FK_civicrm_acl_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `___temp_dreamhost_restore_20100310_014256`.`civicrm_domain` (`id`);

Query: --
--
--
--
ALTER TABLE `civicrm_acl`
ADD CONSTRAINT `FK_civicrm_acl_domain_id` FOREIGN KEY (`domain_id`) REFERENCES `___temp_dreamhost_restore_20100310_014256`.`civicrm_domain` (`id`);

MySQL: Can't create table 'ASF_civicrm.#sql-510_196' (errno: 150)

Can anyone help me, please?

Thanks

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: SQL error when trying to backup a database
April 13, 2010, 10:54:23 am
Appears that you need "SET foreign_key_checks = 0;" when you export. Your export tool should be able to do this automatically, and then it will also reset that variable to 1 when it's done.

See here for more technical information: http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

c-c-m

  • Guest
Re: SQL error when trying to backup a database
April 13, 2010, 03:53:24 pm
thank you!

I think I manage to do it (my phpmyadmin is in not in English) and seems to be working now. Never faced to "Foreighn key" before (never worked with CiviCRM before neither ;) )

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: SQL error when trying to backup a database
April 13, 2010, 03:55:12 pm
Happy to help. :)
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • SQL error when trying to backup a database

This forum was archived on 2017-11-26.