TechSpott - Computer and technology forums

Go Back   TechSpott - Computer and technology forums > Webmasters > Database Management > MySQL
MySQL Forum dedicated to the world's most popular open source database engine.

Reply
 
Thread Tools Display Modes
Old April 27th, 2010, 06:08 PM   #1 (permalink)
Walross
Guest
 
Posts: n/a
Default How to avoid MySQL to check foreign keys when creating a database from a dump script?

I have a MySQL dump file and I want to create a database from it. It's a very large file (1.3 GB) and I know it will take a lot of time to be ready.

But I'm having problem with the constraint check, because when it attempt to create a table, it cannot found the parent table. I added a SET FOREIGN_KEY_CHECKS = 0 at the beginning of the script and a SET FOREIGN_KEY_CHECKS = 1 at the end, but it still doesn't work. I get a ERROR 1005 (HY000).

Why is this happening? Shouldn't SET FOREIGN_KEY_CHECKS = 0 tell MySQL to avoid checking if the parent table exists? What can I do? This script creates 158 tables and I cannot change the order to avoid this error, the file has over 10,000,000 lines!

Any suggestions? Thanks a lot!
  Reply With Quote Share with Facebook
Reply

Bookmarks

Tags
avoid, check, creating, database, dump, foreign, keys, mysql, script


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Oracle Announces MySQL Cluster 7.1 News Bot News 0 April 13th, 2010 09:47 PM
how do i get this php script to print out a result from a mysql database? Gaylord MySQL 0 April 9th, 2010 02:06 PM

 
Forum Stats
Members: 14,376
Threads: 20,386
Posts: 27,885
Total Online: 40

Newest Member: flyocanthy

Latest Threads

Advertisements

Support our advertisers!

Amazon
Sears
Macys
1800flowers.com
Drugstore.com


Carbonite Online-Backups
Tiger Direct
Tech Depot
Buy.com
Office Depot
Fatcow
HostGator


TripsNow.us
Marriott
Expedia
CheapTickets.com
OneTravel
Hotwire

Are you a Fan?

Share this on Facebook

Tag Cloud

Partner Links


Contact Us - Home - Archive - Privacy Statement - Top - Copyright © 2009-2010, TechSpott - All times are GMT -4. Time is 10:50 PM

Powered by vBulletin® Copyright © Jelsoft Enterprises Ltd. :: SEO by vBSEO