How to Increase Import Size Limit in phpMyAdmin
Asked Answered
A

21

81

Does anyone know if or how you can increase the import size limit in phpMyAdmin? Currently my server is limited to 50MB.

Please note that this is not the same as the upload_max_filesize in php.ini. That value is set to 2MB.

I need to import a table into one of my DBs and the phpMyAdmin restriction of 50MB on the import is preventing me from doing that.

Thanks.

Amended -- attached are 2 screen shots:

Screen Shot #1 -- phpinfo() showing the php.ini settings. enter image description here Screen Shot #2 -- showing the phpMyAdmin import restriction enter image description here

Atkins answered 3/10, 2012 at 11:45 Comment(2)
youtu.be/LKEZPVujTgI see hereTreenatreenail
#9593628Padrone
I
50

Could you also increase post_max_size and see if it helps?

Uploading a file through an HTML form makes the upload treated like any other form element content, that's why increasing post_max_size should be required too.

Update : the final solution involved the command-line:

To export only 1 table you would do

mysqldump -u user_name -p your_password your_database_name your_table_name > dump_file.sql

and to import :

mysql -u your_user -p your_database < dump_file.sql 

'drop table your_tabe_name;' can also be added at the top of the import script if it's not already there, to ensure the table gets deleted before the script creates and fill it

Irreversible answered 3/10, 2012 at 11:53 Comment(16)
Thanks @mbathelemy. First off it is not a php.ini issue with post_max_size. That value is set to 8M. I have added screen shots to my question to show exactly what I am referring too. Please note that the SysAdmin at the hosting company told me that value can't be changed. I find that hard to believe. Did the developer(s) of phpMyAdmin hard code this restriction with no option to change?Atkins
If you think you will hit problems while importing your file because of the 50MC phpmyadmin limit, you WILL also hit the php.ini limits before (since they are set to values much lower than 50MB)Irreversible
Thanks @mbarthelemy, but I am not clear on your comment. What is interesting is that I am in the process of exporting and importing an entire DB with 17 tables. All 17 tables total approx 80MB. One table totals 50.5MB (doesn't that figure). So when I batch the other 16 tables they total about 30MB and I was able to import them with no problem. Hence the 8M post_max_size does not come into play, and the 2M upload_max_filesize does not come into play either. Only the 50MB phpMyAdmin restriction comes into play.Atkins
@H.Ferrence thanks a lot for this additional information. Unfortunately, and I'm sorry about that, I still think that the root of your problem is a configuration value that limits you. If the values of php.ini are ignored, they are probably overriden somewhere (inside phpmyadmin config?) Also, did you try to compress the file you import to reduce its size, since it seems to be supported by phpmyadmin?Irreversible
Thanks @Irreversible -- the imported files are compressed and zipped at the sizes I stated earlier. I mean, I am onto every aspect of what I need to do, how to do it, what the parameters and restrictions are, etc. I am just needing to know how and where the developers for phpMyAdmin set the 50MB restriction level and how I can change it (if at all).Atkins
(continued) Still - I find it hard to believe that a tool as powerful and sophisticated as phpMyAdmin is, that the developer(s) overlooked this one little detail. Somehow/somewhere they plugged in the value of 50MB and believe me their tool checks that value and rejects the import if the incoming file size exceeds 50MB.Atkins
Maybe it's not the original developers. I googled a bit and phpmyadmin doesn't seem to override php.ini settings (at least no those related to upload and form data size). Do you use a Phpmyadmin provided (and maybe 'tuned') by a hosting company, or did you setup it yourself?Irreversible
installed by hosting company. plus I googled and searched the entire phpMyAdmin forum. There are numerous questions asked there exactly on the same issue I am asking about. And believe it or not, every single question went unanswered. Changing the phpMyAdmin limit seems to be a huge mystery.Atkins
I know it's definitely the direct solution to your question, but did you consider managing your import/exports from command line? It would save you some time and headaches.. Do you have something like an SSH access to your database?Irreversible
I do have SSH access @mbarthelemy. I was trying to use the phpMyAdmin tool for streamlining purposes. I am not completely clear on the commands to use at the command line to import my exported DB Tables.Atkins
The commands would be very easy: to export only 1 table you would do 'mysqldump -u user_name -p your_password your_database_name your_table_name > dump_file.sql', and to import : mysql -u your_user -p your_database < dump_file.sqlIrreversible
Ok, thanks @mbarthelemy. Will the import completely overwrite the existing tables in the DB that is already setup on the target server? I want it to overwrite completely.Atkins
I'm sorry, I don't have a mysql access right now. you can test and see if the table is automatically deleted when you import. If not, you can add 'drop table your_table' at the top of the exported .sql file. Also, as the problem was initially about getting phpmyadmin to work, maybe you can check the phpmyadmin config file (which should be named like 'config.something.inc') for php config values, since you have an SSH access?Irreversible
Awesome @Irreversible -- your command line import worked ! Well, I know you knew it would, but it was the solution to my server-side restriction...Atkins
@H.Ferrence glad to know I helped you! I updated my answer with the final solution, even if it's not a real one, given that the initial question was about phpmyadminIrreversible
Changing post_max_size fixed the issue for me on localhost on lamp.Pie
A
74

If you are using WHM/Cpanel then in order to change that "Max: 50MiB" limit in the import section of phpmyadmin, you will have to change two values in WHM (Web Host Manager).

Step 1) Go to Tweak settings, find the "cPanel PHP Max upload size" change it according to your needs. Save changes.

Step 2) Go to Tweak settings, find the "cPanel PHP Max POST size" change it according to your needs. Save changes.

Go back to your phpMyadmin. The value should have changed.

enter image description here

enter image description here

enter image description here

Antechamber answered 17/10, 2013 at 8:9 Comment(3)
This did not work for me at first, I had to reboot the whole server for it to update for phpmyadmin, once done though it worked. ThanksPiccolo
Cpanel updated guide on this, roughly the same thing: support.cpanel.net/hc/en-us/articles/…Padrone
Compressing the file might be an obvious step but helps a lot. Whether using phpMyAdmin or in command line this can make a big difference. Personally, my SQL file shrank from ~1 gb to just ~80 mb. Irfan Ullah Khan's answer explains more.Padrone
M
71

I had the same problem with my working correctly by doing the following

changes into the php.ini file

post_max_size = 800M 
upload_max_filesize = 800M 
max_execution_time = 5000 
max_input_time = 5000 
memory_limit = 1000M 

now restart for the changes to take effect

Majordomo answered 8/5, 2014 at 17:1 Comment(2)
On my local phpmyadmin environment, I only had to modify post_max_size and restart apache. The new size was then shown in the phpmyadmin "File to import" section. But I suppose if your server is remote and/or your upload file is large, you'll want to change those other values.Thales
you need to update max_allowed_packet on my.ini at C:\xampp\mysql\bin\my.iniHydrothorax
I
50

Could you also increase post_max_size and see if it helps?

Uploading a file through an HTML form makes the upload treated like any other form element content, that's why increasing post_max_size should be required too.

Update : the final solution involved the command-line:

To export only 1 table you would do

mysqldump -u user_name -p your_password your_database_name your_table_name > dump_file.sql

and to import :

mysql -u your_user -p your_database < dump_file.sql 

'drop table your_tabe_name;' can also be added at the top of the import script if it's not already there, to ensure the table gets deleted before the script creates and fill it

Irreversible answered 3/10, 2012 at 11:53 Comment(16)
Thanks @mbathelemy. First off it is not a php.ini issue with post_max_size. That value is set to 8M. I have added screen shots to my question to show exactly what I am referring too. Please note that the SysAdmin at the hosting company told me that value can't be changed. I find that hard to believe. Did the developer(s) of phpMyAdmin hard code this restriction with no option to change?Atkins
If you think you will hit problems while importing your file because of the 50MC phpmyadmin limit, you WILL also hit the php.ini limits before (since they are set to values much lower than 50MB)Irreversible
Thanks @mbarthelemy, but I am not clear on your comment. What is interesting is that I am in the process of exporting and importing an entire DB with 17 tables. All 17 tables total approx 80MB. One table totals 50.5MB (doesn't that figure). So when I batch the other 16 tables they total about 30MB and I was able to import them with no problem. Hence the 8M post_max_size does not come into play, and the 2M upload_max_filesize does not come into play either. Only the 50MB phpMyAdmin restriction comes into play.Atkins
@H.Ferrence thanks a lot for this additional information. Unfortunately, and I'm sorry about that, I still think that the root of your problem is a configuration value that limits you. If the values of php.ini are ignored, they are probably overriden somewhere (inside phpmyadmin config?) Also, did you try to compress the file you import to reduce its size, since it seems to be supported by phpmyadmin?Irreversible
Thanks @Irreversible -- the imported files are compressed and zipped at the sizes I stated earlier. I mean, I am onto every aspect of what I need to do, how to do it, what the parameters and restrictions are, etc. I am just needing to know how and where the developers for phpMyAdmin set the 50MB restriction level and how I can change it (if at all).Atkins
(continued) Still - I find it hard to believe that a tool as powerful and sophisticated as phpMyAdmin is, that the developer(s) overlooked this one little detail. Somehow/somewhere they plugged in the value of 50MB and believe me their tool checks that value and rejects the import if the incoming file size exceeds 50MB.Atkins
Maybe it's not the original developers. I googled a bit and phpmyadmin doesn't seem to override php.ini settings (at least no those related to upload and form data size). Do you use a Phpmyadmin provided (and maybe 'tuned') by a hosting company, or did you setup it yourself?Irreversible
installed by hosting company. plus I googled and searched the entire phpMyAdmin forum. There are numerous questions asked there exactly on the same issue I am asking about. And believe it or not, every single question went unanswered. Changing the phpMyAdmin limit seems to be a huge mystery.Atkins
I know it's definitely the direct solution to your question, but did you consider managing your import/exports from command line? It would save you some time and headaches.. Do you have something like an SSH access to your database?Irreversible
I do have SSH access @mbarthelemy. I was trying to use the phpMyAdmin tool for streamlining purposes. I am not completely clear on the commands to use at the command line to import my exported DB Tables.Atkins
The commands would be very easy: to export only 1 table you would do 'mysqldump -u user_name -p your_password your_database_name your_table_name > dump_file.sql', and to import : mysql -u your_user -p your_database < dump_file.sqlIrreversible
Ok, thanks @mbarthelemy. Will the import completely overwrite the existing tables in the DB that is already setup on the target server? I want it to overwrite completely.Atkins
I'm sorry, I don't have a mysql access right now. you can test and see if the table is automatically deleted when you import. If not, you can add 'drop table your_table' at the top of the exported .sql file. Also, as the problem was initially about getting phpmyadmin to work, maybe you can check the phpmyadmin config file (which should be named like 'config.something.inc') for php config values, since you have an SSH access?Irreversible
Awesome @Irreversible -- your command line import worked ! Well, I know you knew it would, but it was the solution to my server-side restriction...Atkins
@H.Ferrence glad to know I helped you! I updated my answer with the final solution, even if it's not a real one, given that the initial question was about phpmyadminIrreversible
Changing post_max_size fixed the issue for me on localhost on lamp.Pie
R
39

Change these values in php.ini

post_max_size = 750M 
upload_max_filesize = 750M 
max_execution_time = 5000 
max_input_time = 5000 
memory_limit = 1000M 

Then restart Wamp for the changes to take effect. It will take some time. If you get following error:

Script timeout passed if you want to finish import please resubmit same zip file and import will resume.

Then update the phpMyAdmin configuration, at phpMyAdmin\libraries\config.default.php

/**
 * maximum execution time in seconds (0 for no limit)
 *
 * @global integer $cfg['ExecTimeLimit']
 */
$cfg['ExecTimeLimit'] = 0;
Recti answered 7/7, 2015 at 10:53 Comment(0)
O
12

I had the same problem. My .sql file was 830 MB and the phpMyAdmin import size allowed was 50MB (just as shown in the screenshot). When I zipped the file to .zip its size became about 80 MB. Then I zipped it to bzip2 format, and I was amazed to see that the file size was compressed to just 12MB (from 830MB to 12MB!!!). As phpMyAdmin allows three compression types i.e. .zip , .gzip and .bzip2 , therefore I uploaded the compressed bzip2 file and viola.... it was imported to the database!!! So by using the right compression, I was able to import a 830MB .sql file into phpMyAdmin.

NOTE: phpMyAdmin import page clearly instructs that the compressed filename should be like filename.sql.bz2 . It should not be like filename.bz2 .

NOTE 2: You can compress your .sql file to bzip2 compressed file using 7-Zip software. cPanel also has an option to compress a file to bzip2 format.

Oddity answered 29/11, 2013 at 6:56 Comment(1)
Worked great for my 270MB file, compressed down to 17MB using Mac OS built in bzip2. I also removed the time limit, edit $cfg['ExecTimeLimit'] = 0; for files config.default.php and config.inc.php since I'm using MAMP.Masonry
C
8

First you have to change values in php.ini file as per your requirements.

post_max_size = 1024M 
upload_max_filesize = 1024M 
max_execution_time = 3600
max_input_time = 3600 
memory_limit = 1024M 

Note - Change these values carefully. These values will impact for all of your projects of that server.

Now, If above solutions are not working, kindly check your phpmyadmin.conf file. If you are using WAMP so you can find the file in "C:\wamp64\alias".

You have to change below values.

Values already in file are -

  php_admin_value upload_max_filesize 128M
  php_admin_value post_max_size 128M
  php_admin_value max_execution_time 360
  php_admin_value max_input_time 360

Change above code to -

#  php_admin_value upload_max_filesize 128M
#  php_admin_value post_max_size 128M
#  php_admin_value max_execution_time 360
#  php_admin_value max_input_time 360

Now just restart your server, to work with changed values. :)

Coconut answered 24/2, 2017 at 10:26 Comment(0)
Q
5

You can increase the limit from php.ini file. If you are using windows, you will the get php.ini file from C:\xampp\php directory.

Now changes the following lines & set your limit

post_max_size = 128M
upload_max_filesize = 128M 
max_execution_time = 2000
max_input_time = 3000
memory_limit = 256M
Quandary answered 3/10, 2012 at 11:45 Comment(0)
T
5

this is due to file size import limit in phpmyadmin, default is very low, so you should increase upload_max_filesize you can change this in your php.ini, replaced with this

upload_max_filesize = 100M

Thundershower answered 24/4, 2015 at 2:26 Comment(0)
G
3

go to your cpanel and search "ini editor". You'll get "Multiphp INI Editor" There you select your wordpress directory and put upload_max_filesize = 256M post_max_size = 256M memory_limit = 256M

enter image description here

Goodfornothing answered 4/9, 2018 at 6:13 Comment(0)
C
3

Be sure you are editing php.ini not php-development.ini or php-production.ini, php.ini file type is Configuration setting and when you edit it in editor it show .ini extension. You can find php.ini here: xampp/php/php

Then

upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 900
max_input_time = 50000000
memory_limit = 256M

enter image description here]

Cinchonidine answered 29/3, 2019 at 16:21 Comment(0)
A
2

If you have direct root SSH access to the machine you will be able to change the settings in: /usr/local/cpanel/3rdparty/etc/phpmyadmin/php.ini

Just change the line: upload_max_filesize = 50M

Azeotrope answered 6/6, 2013 at 17:16 Comment(1)
Did you not read the question? Please note that this is not the same as the upload_max_filesize in php.ini. That value is set to 2MB.Chopstick
F
2

if you're using xampp, find the php.ini (in xampp folder itself), go to line 735 and change the post_max_size to the value you wish. ex: if you want to upgrade to 80MiB,

post_max_size = 80M

make sure to restart apache after changing the value.

That's it...

Flux answered 19/11, 2013 at 22:18 Comment(1)
Yeah, it's specifically this value that affects the max upload limit in phpmyadmin. Others have mentioned this, but also mentioned changing other settings which are indirectly related. Sometimes it's best to just change just the setting you need, so you know what setting does what. If you hit other limits, then you change those as you go.Crissie
G
2

Change the file phpmyadmin.conf on c:/wamp64/alias/phpmyadmin.conf

php_admin_value upload_max_filesize 512M
php_admin_value post_max_size 512M
php_admin_value max_execution_time 360
php_admin_value max_input_time 360

It's very important you increase the time to 5000 or higher, Thus, the process will not stop when you are uploading a large file.

That works for me.

Giselegisella answered 13/3, 2017 at 22:22 Comment(0)
I
1

1:nano /etc/php5/apache2/php.ini
you can find your php.ini location by uploading a file called phpinfo.php with the following contents<?php phpinfo();?> and access it by visiting yourdomain.com/phpinfo.php ,you will see the results

2:change the desired value to upload_max_filesize and post_max_size such as : upload_max_filesize = 200M post_max_size = 300M then it will become 200M.

3:restart your apache

Inaccuracy answered 30/12, 2016 at 12:0 Comment(0)
A
1

IF YOU ARE USING NGINX :

  1. cd /etc/php/<PHP_VERSION>/fpm example => cd /etc/php/7.2/fpm

  2. nano php.ini

    post_max_size = 1024M 
    upload_max_filesize = 1024M 
    max_execution_time = 3600 
    max_input_time = 3600 
    memory_limit = 1024M 
    
  3. after saving php.ini file , restart fpm using :

    systemctl restart php<PHP_VERSION>-fpm
    

example => systemctl restart php7.2-fpm

Avunculate answered 30/11, 2020 at 7:5 Comment(0)
F
0

I increased the max file size by going to CPanel > Select PHP version > Switch to PHP Extensions and then scroll to the upload_max_filesize field (it will have a clickable link for the size - mine was set at 2MB) and I increased it to 256MB. Then click "Save".

Fulk answered 18/5, 2015 at 8:39 Comment(0)
J
0

You Can Search php.ini file in C:\xampp\htdocs

changes into the php.ini file

post_max_size = 805M 
upload_max_filesize = 805M 
max_execution_time = 5005 
max_input_time = 5005 
memory_limit = 1005M 

After editing Please restart XAMPP

Joellajoelle answered 19/10, 2016 at 6:35 Comment(0)
M
0

On newer version of cpanel: search ini

Select the Home Directory

Scrool down to 'upload_max_filesize' and edit it...then save[enter enter image description here

Missend answered 16/5, 2017 at 13:32 Comment(0)
L
0

Sharky's answer was spot on. The phpMyAdmin upload file size displayed is NOT managed by the php.ini settings, which you can see when you run a phpinfo.php containing:

<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?>

It is good practice to increase your php.ini settings for:

post_max_size upload_max_filesize max_execution_time max_input_time memory_limit

You may use the settings example that Sujiraj R shared. Once you have made all of the changes to both your php.ini AND in the"Tweak Settings" area of WHM, when you launch phpMyAdmin and go to the import screen, you will see the size you selected for "cPanel PHP max upload size" field.

There were a lot of good answers on this post, but you had to look back and forth to get the right answer. I hope that by encapsulating those previous answers in this post I have helped just a bit. All of the answers I refer to on this post were derived by others that posted here, so please do not credit me with any of the answers posted herein.

Literator answered 9/10, 2017 at 19:4 Comment(0)
S
0

If you don't want to change the upload size limit, or for some reason can not change the upload size limit, compressing the database to a zip or tar.bz2 will really reduce the size of your database. In my case it went from 60MB which was >10MB over the limit, and compressed to a zip it was only 18MB!

Stay answered 20/12, 2022 at 11:36 Comment(1)
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From ReviewNaman
U
0

open alias/phpmyadmin5.conf

and do the following changes

enter image description here

Undoubted answered 3/6 at 10:29 Comment(1)
This answer is rather similar to João's, as well as Edy's and Abey's, although they amend an INI file. For text output and text file changes, text-blocks are preferred over images. Triple-back-ticks can be used to preserve whitespace and formatting.Magdalenmagdalena

© 2022 - 2024 — McMap. All rights reserved.