While importing a CSV file into Magento 2, you may face the following restriction: the size of your file is more than allowed. Below, we shed light on how to change the limit. If you are interested in more tips related to Magento 2, view our Developer’s Cookbook.
To change the maximum allowed import CSV file size:
- find your php.ini file;
- find the “upload_max_filesize” parameter (additionally, check ‘post_max_size’ too);
- replace the existing value with a bigger one;
- restart your MySQL and Apache server;
- reload import page.
Besides, increase the execution time to avoid timeout issue.
As for the MySQL configuration, perform the following steps:
- go to the importexport_importdata table;
- find the ‘max_allowed_packet’ Mysql parameter;
- it should be 1.5 times greater than the size of your import CSV file.
Now, you can upload a CSV file of any size to your Magento 2.