Import big database

Uploading / Importing big database through command line.

1) Set the mysql as environment variable.

2) go to the folder where the sql dump file is stored.

3) Run the command  :\>mysql -u username -p -h hostname databasename < sql_dump_file_name.

If you get any error like “Mysql server has gone away” or “got a packet bigger than ‘max_allowed_packet’ bytes”

Please follow the below steps.

a) Run the command :\>mysql -u root -p

b) It will ask for password, if you have any password set enter it or simple click the Enter button.

c) Now you will see the command prompt as mysql>

d) Now run the below to commands 

mysql> set global max_allowed_packet=1000000000;
mysql> set global net_buffer_length=1000000;


Now follow above mentioned 2 and 3 point.

If every thing went fine your database is upload is successful.


Example :

Let say you are running on the xampp which is installed in the D drive.

You have placed the sql dump folder in the xampp folder

Go the command prompt.


D:\>cd xampp

D:\xampp>mysql -u username -p -h hostname databasename < sql_dump_file_name.sql


For further reference please follow the below link




One thought on “Import big database

Leave a Reply

Your email address will not be published. Required fields are marked *