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) »
  • Foreign key constraint error on phpmyadmin import
Pages: [1]

Author Topic: Foreign key constraint error on phpmyadmin import  (Read 4318 times)

palmquist

  • I post occasionally
  • **
  • Posts: 34
  • Karma: 2
  • CiviCRM version: 4.5.6
  • CMS version: Drupal 7.26
  • MySQL version: 5.5.36-log
  • PHP version: 5.4.24
Foreign key constraint error on phpmyadmin import
March 10, 2010, 07:54:10 am
I have re-installed Drupal and CiviCRM and am trying to restore my data, and phpmyadmin keeps giving me a foreign key constraint error.  I now see that I should have disabled foreign key constraints upon exporting, but is there anything I can do now to get my data back?

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Foreign key constraint error on phpmyadmin import
March 11, 2010, 01:00:59 am
Quote from: palmquist on March 10, 2010, 07:54:10 am
I have re-installed Drupal and CiviCRM and am trying to restore my data, and phpmyadmin keeps giving me a foreign key constraint error.  I now see that I should have disabled foreign key constraints upon exporting, but is there anything I can do now to get my data back?

Check this reply – you can simply open the dump with a text editor and add

Code: [Select]
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;

at the beginning and

Code: [Select]
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;

at the end.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Foreign key constraint error on phpmyadmin import

This forum was archived on 2017-11-26.