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:

database-import

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.

  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

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 *