HOBALL 筆記簿

July 30, 2008

MySQL Import large database using commands

Filed under: SQL — Tags: , , , , — hoball @ 11:50 am

If you have a very large database, it is frustrating to restore/import it using HTTP as most probably there are transfer limit.
So, it is time to use the command prompt. Firstly, upload the sql file to an easily accessed folder(Windows/Linux). Then run the command:

mysql -u xxx -p -h SERVER_PATH DATABASE_NAME < file.sql

If the database is not created, you can create it first, by using:

CREATE DATABASE database_name;

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

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

Create a free website or blog at WordPress.com.

%d bloggers like this: