MySQL Import large database using commands

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 Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s