Error while uploading zipped database file

Hi

I want to upload 4MB zipped mysql database file in the XAMPP phpmyadmin.

Everytime its giving me error

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 31798080 bytes) in E:\xampp\phpMyAdmin\libraries\unzip.lib.php on line 325 

Xampp Memory Limit is 32M

If its 32M = 32mb , then it should be able to upload 4MB zipped file.

But its giving error

Thanks
Vineet

The zip file may be 4 MB but unzipped can be much more than that. :slight_smile:

Hi molona

you mean to say that while uploading it will consider the size of the zipped file as of unzipped file.

if unzipped version is = 20MB, Then it will consider 4MB as 20mb file ??

vineet

Based on your error. Yes. phpMyAdmin is attempting to unzip the zip file after it is uploaded and is exceeding its memory allocation.

Hi cpradio

if PHPMYADMIN is considering the file that way,
then what is the purpose of the extensions zip and gzip provided by the software.

I am not able to understand

thanks
Vineet

phpMyAdmin has to unzip it right? As you need it to restore the database backup? It can’t just accept a zip file and magically restore the database without unzipping it.

Maybe we should start this conversation over again. What exactly are you trying to achieve here?

Hi cpradio

Thanks for clearing my confusion.

I just want to import a zipped 4MB sql file into the phpmyadmin

how to do it in XAMPP

Thanks
Vineet

As long as it’s your machine and not a live host that might not be happy about you doing it, you could try upping the limit eg. I have a large CSV file I’m in the process of importing into a database

ini_set('memory_limit', '512M'); // 4x default
//ini_set('memory_limit', -1); // no limit

@Mittineague probably has the best solution, simply alter your PHP.ini to set the memory limit to no limit (if you don’t want to modify the phpMyAdmin source code) and restart Apache so the changes take effect.

Another alternative is to ditch using phpMyAdmin and install MySQL Workbench which is an application (not dependent on PHP) and can do importing of databases as well (thus no memory limit).

Hi

i created a new php file and added

ini_set('memory_limit', '512M');

then restarted xampp apache

but still the memory in the phpinfo() shows as 32M

In the import screen the 16,384 Kib is also not increasing.

see the screenshot of import screen also
http://s30.postimg.org/5tkeybnu9/16kib.gif

Am i doing something wrong ??

vineet

Are you running your own IMPORT script or trying to use phpMyAdmin?

That isn’t the memory limit, that is the file upload limit, completely different setting.

Plus you can’t do it on a new page, you really should edit the php.ini file.

Hi

i am importing it directly using phpMYADMIN

thanks
vineet

Hi cpradio

I have edited my php.ini file

xampp/php/php.ini

post_max_size = 128M
upload_max_filesize = 128M

restarted xampp apache

Still it is showing 16,384

dont know what to do ??

vineet

Not to take you away from the previous solutions, but for any large mysql imports I ever need to perform, I use Big Dump. It’s a script that handles the import of large files a little bit at a time, allowing you to handle huge files that would otherwise be problematic to import by other means.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.