Home > HOWTOs > Import Large Dump into MySQL.

Import Large Dump into MySQL.

Had to import a Large File into Mysql today.
Here is how you do it. šŸ™‚

Step 1 : Login

mysql -u root -p database_name  

Step 2 : Set network buffer length to a large byte number

set global net_buffer_length=1000000;   

Step 3 : Set maximum allowed packet size to a large byte number

set global max_allowed_packet=1000000000;   

Step 4: Disable foreign key checking to avoid delays,errors and unwanted behaviour

set foreign_key_checks = 0;   

Step 5 : Import Dump

source My_Large_Dump_File.sql  

Step 6: Remember to enable foreign key checks when procedure is complete

SET foreign_key_checks = 1;   

More Details on Importing Large Dump is here. https://cmanios.wordpress.com/2013/03/19/import-a-large-sql-dump-file-to-a-mysql-database-from-command-line/

ā€‹
Advertisements
Categories: HOWTOs
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: