Importing large databases into your localhost installation – XAMP

If you ever tried to import a huge database to your localhost installation, you might have experienced the following error:


No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration. See FAQ 1.16.

That above code basically means that your import failed since there was no data received by phpMyAdmin to import int your database. However, the reason lies in the next line. It is:

  • Either no file name was submitted
  • OR the file size exceeded the maximum size permitted by your PHP configuration

In order to fix this, first, we’ll need to make sure we have named the database file correctly. Just reload the page and try to import it again. If this fails again, then it means you will need to increase the upload limit set on your database. Now, there are times when you cannot increase the maximum upload limits for whatever reason. In such situation, you can follow the following steps to manually import the .sql file into your database.

#Alternate method

  1. Copy the database file into your mysql/bin directory present in your WordPress installation. Usually, the path would be C:\xampp\mysql\bin
  2. Click and hold Shift key and then ‘Right click’ on your mouse. You must then select the option that says ‘Open a command window here’. This shuld open a command prompt
  3. Enter the following code and then hit Enter key
  4. mysql -u root -p db-name < db-file.sql

    You can use a different username instead of root, if you've already created a different user. You also need to replace db-name and db-file.sql with the proper database name and sql file name respectively

  5. You will be prompted to enter the password for the user. If you haven't set any password for root, you can just click Enter key again. If not, enter the password and click on Enter key
  6. Sit back and relax while the database is being imported. A new database will be generated and all the database contents in the sql file will be imported into that database

Alternate method

  1. Access \mysql\bin directory in your xampp folder
  2. Enter the following command and then hit Enter (and keep doing that after entering each of the commands in the next steps). It will ask you for the root user password, just hit enter again, since there's no default password setup for the root user (if you did set up a password, make sure to enter it next to -p in the next line)
  3. mysql -u root -p
  4. In the next command, we'll ask mysql to use the database that we'd like to import the sql file into
  5. USE db-name
  6. Next command is where we provide the location of the database file for the mysql server
  7. SOURCE /path/to/sql/db-file.sql

    Replace db-name and /path/to/sql/db-file.sql with the database name and the full file path along with the file name of the sql file that you're trying to import respectively

  8. Let the server complete import of the sql file. It might take some time depending on the size of the sql file. Once done, the sql file should be imported to the database name that we have used in step 3

Please leave a comment if you have any issues following the above steps, or if you want to provide any feedback regarding this post.

/ /

Report (Please include link to post while reporting)

Leave a Reply

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