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) »
  • Drop Tables Error
Pages: [1]

Author Topic: Drop Tables Error  (Read 1833 times)

linkx

  • I post occasionally
  • **
  • Posts: 86
  • Karma: 7
Drop Tables Error
October 01, 2007, 08:32:19 pm
Trying to clean up my Drupal Database after uninstalling CiviCRM 1.7

Using PHPmyAdmin I'm trying to drop all civicrm_* tables. I can drop some tables, but others return this error:

Code: [Select]
#1217 - Cannot delete or update a parent row: a foreign key constraint fails
There does not seem to be any rhyme or reason to which will drop and which will not.

Any suggestions?

Thanks!

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Drop Tables Error
October 01, 2007, 09:13:28 pm

table with foreign key constraints are probably causing you the problem. You can set this to 0 by executing:

SET FOREIGN_KEY_CHECKS=0

in your sql window on PMA

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

linkx

  • I post occasionally
  • **
  • Posts: 86
  • Karma: 7
Re: Drop Tables Error
October 02, 2007, 09:04:04 am
Thanks for the reply. I successfully executed the query in PMA but my problem remains. Any other suggestions?

speleo

  • Ask me questions
  • ****
  • Posts: 396
  • Karma: 28
  • CiviCRM version: 4.3.1
  • CMS version: J! 2.5,9
  • MySQL version: 5.1
  • PHP version: 5.3.24
Re: Drop Tables Error
October 02, 2007, 12:57:29 pm
Hi Linkx, This method does work as I've used it myself before. Did you issue the command as a one off or in the scope of a chain of commands.

eg

mysql> SET FOREIGN_KEY_CHECKS = 0;
mysql> DROP TABLE  civicrm_*;
mysql> SET FOREIGN_KEY_CHECKS = 1;

linkx

  • I post occasionally
  • **
  • Posts: 86
  • Karma: 7
Re: Drop Tables Error
October 03, 2007, 09:36:46 am
 ;D

Thanks a bunch! I just had to use your suggestion and run it all at once. I could not get the wildcard to work with a DROP query so I just listed them all with SHOW TABLES LIKE 'civicrm_%' and then comma-separated the list and ran this query:

THANK YOU SO MUCH!

Code: [Select]
SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE
civicrm_contribution_page,
civicrm_contribution_recur,
civicrm_contribution_type,
civicrm_country,
civicrm_currency,
civicrm_custom_field,
civicrm_custom_group,
civicrm_custom_option,
civicrm_custom_value,
civicrm_dedupe_rule,
civicrm_dedupe_rule_group,
civicrm_domain,
civicrm_email,
civicrm_entity_file,
civicrm_entity_tag,
civicrm_event,
civicrm_file,
civicrm_financial_trxn,
civicrm_group,
civicrm_household,
civicrm_im,
civicrm_individual,
civicrm_line_item,
civicrm_location,
civicrm_location_type,
civicrm_log,
civicrm_mailing,
civicrm_mailing_bounce_pattern,
civicrm_mailing_bounce_type,
civicrm_mailing_component,
civicrm_mailing_event_bounce,
civicrm_mailing_event_confirm,
civicrm_mailing_event_delivered,
civicrm_mailing_event_forward,
civicrm_mailing_event_opened,
civicrm_mailing_event_queue,
civicrm_mailing_event_reply,
civicrm_mailing_event_subscribe,
civicrm_mailing_event_trackable_url_open,
civicrm_mailing_event_unsubscribe,
civicrm_mailing_group,
civicrm_mailing_job,
civicrm_mailing_trackable_url,
civicrm_mapping,
civicrm_mapping_field,
civicrm_meeting,
civicrm_membership,
civicrm_membership_block,
civicrm_membership_log,
civicrm_membership_payment,
civicrm_membership_status,
civicrm_membership_type,
civicrm_msg_template,
civicrm_note,
civicrm_option_group,
civicrm_option_value,
civicrm_organization,
civicrm_participant,
civicrm_participant_payment,
civicrm_payment_processor,
civicrm_payment_processor_type,
civicrm_phone,
civicrm_phonecall,
civicrm_preferences,
civicrm_premiums,
civicrm_premiums_product,
civicrm_price_field,
civicrm_price_set,
civicrm_product,
civicrm_relationship,
civicrm_relationship_type,
civicrm_saved_search,
civicrm_state_province,
civicrm_tag,
civicrm_task,
civicrm_uf_group,
civicrm_validation;
SET FOREIGN_KEY_CHECKS = 1;

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Drop Tables Error

This forum was archived on 2017-11-26.