One of my staff asked me on how to upload a 345MB SQL dump file he extracted from one of our DB servers to another server. He told me that he is having a problem doing this task using PhpMyAdmin because of the 2MB limitation found PhpMyAdmin’s import screen.

I know that the procedure below is very basic to others but still, allow me to give you the easiest way on how to upload an SQL dump file to another server:

  1. Upload the .SQL dump file to your target MySQL server via FTP or SFTP.
  2. Type the command below:
    mysql --user=username –password=password DB_name < dumpfile.sql
  3. Congratulations!

NOTES:

  1. The command used above will upload the table(s) and records inside dumpfile.sql to an existing database named DB_name.If the “CREATE TABLE” portion in the dumpfile.sql is present then it will create the table(s) inside DB_name, provided that the table(s) is (are) not yet in the DB_name.
  2. If the table(s) is (are) already in the DB_name and you just want to insert records inside the table(s), you need to remove the “CREATE TABLE” portion inside the dumpfile.sql. Just make sure that the fields of the existing table are the same with the fields in the dumpfile.sql you want uploaded.

Popularity: 2% [?]