Tech Tips on Computers, Internet, Blogging, Web Development, Social Media, Android and more

Full width home advertisement

Post Page Advertisement [Top]


unable to import mysql database php file size exceeded

Tried uploading a mysql database file in phpMyAdmin and failed to upload due to the error- "the file size exceeded the maximum size permitted by your PHP configuration"? In this post, we shall see "How to increase the size of database import file in phpmyadmin?".


Issue scenario:
  • Took a backup of a live website’s database to work locally on a development computer running  a WAMP Server on the development machine.
  •  Tried to import the database file (a .sql file) of approximately 6MB but PHPMYADMIN would throw the following error while attempting to 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.



If you encountered a similar error message from PHPMYADMIN, then this is how to fix it. This example is from a local development point of view. If you are facing this issue on a production system with "Shared Hosting", you may need to contact the service provider as you may not have access to make changes to php setting / properties from your end.

Steps to increase the size of import file in phpmyadmin to resolve the database import issue / limitation:

  • Locate the PHP configuration file
    • The PHP configuration file is named “php.ini” and is located at “C:\wamp\bin\apache\Apache2.2.17\bin
    • If you are using WAMP, you can also find it in the menu for PHP from the WAMP Control Panel
  •  Make a backup of the “php.ini” file before making any changes to the file so that we can restore using the backup if there are any issues
  • Open the “php.ini” file in a file editor such as Notepad ++
    • Find the string "post_max_size"
    • The default might be  "post_max_size = 8M"
    • Change the value of "post_max_size" to a value more than the file size you intend to upload. 
  • Find for the string "upload_max_filesize"
    • It might probably be set to “upload_max_filesize = 2M”
    • Change the value of "upload_max_filesize " to a value more than the file size you intend to upload. In my case I set it to 10M for both
 
    upload max filesize php ini
  • You must ensure that post_max_size is the same or larger than upload_max_filesize .
  • Save the file
  • Restart APACHE AND MYSQL services from WAMP Control Panel
  • Go to phpmyadmin > import and try importing the file again.
You should be able to import the mysql database file after making the above changes to the php.ini settings.

No comments:

Post a Comment

Bottom Ad [Post Page]