Skip to Main Content
Home

Richard@Home

Filtering out the crap so you don't have to
  • Portfolio
  • About
  • Life Feed
  • Contact
Home

truncate

Richard's picture

MySQL: Disable foreign keys while updating database

Posted Sat, 01/30/2010 - 08:51 by Richard

Originally found here: http://www.stetsenko.net/2008/10/mysql-how-to-ignore-checking-of-foreign-key-constraints-for-innodb-tables/

Making a note of it here because it always take me a while to find the above article.

You can switch off checking of foreign keys while you truncate/populate the tables in a MySQL database with:

SET FOREIGN_KEY_CHECKS = 0;

and re-enable it with:

  • Richard's blog
  • 2 comments
  • Read more

Tags in Richard@Home

CakePHP Drupal GeekUp Helper MySQL Pagination Paginator PHP presentation Sheffield Sort tip
more tags

Recently on Richard@Home

  • Quick Tip: Drupal Drush Out of Memory Error on Ubuntu
  • PHP function any_in_array - tests if any of $needles are in $haystack
  • CakePHP: Extend PaginatorHelper to indicate sort field and direction
  • CakePHP: Smarter links
  • Quick CakePHP Tip: Prefix/Admin Routing and form->create()
  • CakePHP Quick tip: Adding CSS links to $scripts_for_layout in 1.3
  • MySQL: Disable foreign keys while updating database
  • CakePHP: Pagination with Containable
  • einstein_www
  • Must Have Software
  • 1
  • 2
  • next ›
  • last »

Syndicate content

Syndicate

Syndicate content

free debate