Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I have a WordPress production website.

I've exported the database by the following commands: select database > export > custom > select all tables > select .zip compression > 'Go'

I've downloaded the file which is example.sql.zip but when I upload to my localhost I get this error: phpMyAdmin - Error > Incorrect format parameter

I've tried to export with other formats and I get the same error.

I've tried with other SQL Databases and it exports/ imports just fine.

What could it be? A corrupt database or other?

Thanks

This issue is not because of corrupt database but rather the PHP upload size limit. It is suggested to increase the values of the following variables in php.ini :

upload_max_filesize=64M
post_max_size=64M

You may also want to increase the max_exection_time to a longer value for larger databases so it does not timeout while uploading.

Save you changes to the file and restart your PHP server.

Thanks for the idea which was a good one, however it still didn't work. I'm really out of ideas here... – Henry Jun 9, 2018 at 5:49 Might as well increase the max_exection_time also because the database could be large and triggger a timeout. – Whip Jul 24, 2018 at 5:23 that's correct.. both config together is a correct answer. not first item. I try to resolve by first item and cant. but when do second solved. thanks, StackOverflow thanks pooja. – saber tabatabaee yazdi Oct 11, 2018 at 17:55 See this question also if you're using MAMP because you might have a hard time finding php.ini, like I did. – GDP2 May 7, 2019 at 23:34

Compress your .sql file, and make sure to name it .[format].[compression], i.e. database.sql.zip.

As noted above, PhpMyAdmin throws this error if your .sql file is larger than the Maximum allowed upload size -- but, in my case the maximum was 50MiB despite that I had set all options noted in previous answers (look for the "Max: 50MiB" next to the upload button in PhpMyAdmin).

This worked for me. I had max_execution_time=0 and post_max_size=100M, but an 80 MB file still gave an error. Zipping as file.sql.zip did the trick. – jogi99 Nov 20, 2018 at 17:15 This solved my problem. My sql file was only slightly above the maximal size, but note that compressing can reduce the size significaltly: In my case 16-fold. – Paul Mar 12, 2019 at 10:22 This helped me. I had 100MB set in php.ini and the file was generating the error at 46% of the upload, which was 43MB. I zipped it and no problem. – Doug Wolfgram Apr 17, 2019 at 1:30

For me, adjusting the 2 values was not enough. If the file is too big, you also need to adjust the execution time variables.

First, ../php/php.ini

upload_max_filesize=128M
post_max_size=128M
max_execution_time=1000

Then, ../phpMyAdmin\libraries\config.default.php

$cfg['ExecTimeLimit'] = 1000;

This did the trick for me. The variables can be choosen differently of course. Maybe the execution time has to be even higher. And the size depends on your filesize.

None of these answers worked for me. I had to use the command line:

mysql -u root db_name < db_dump.sql
SET NAMES 'utf8';
SOURCE db_dump.sql;

Done!

This is the correct way, it seems, from the default phpmyadmin docker image docs. I would like to add that if one is using nginx as a proxy pass, they must set proxy_read_timeout (i.e. proxy_read_timeout 1500). – Tim Apr 5, 2021 at 2:13

Just gone through the same problem when trying to import a CSV (400 MBs) and was also getting an error in red saying

Error - incorrect format parameter

Initially thought it could have been the parameters and tested again. Faster, from my previous experince with it, I realized that it was due to other reasons (size of the file, execution of script has a maximum time defined, etc).

So, I've gone to php.ini

and changed the values from the following settings

max_execution_time = 3000
max_input_time = 120
memory_limit = 512M
post_max_size = 1500M
upload_max_filesize = 1500M 

After this modification, stoped MySQL and Apache and started them again, went to phpmyadmin trying to import. Then I reached another error

Fatal error: Maximum execution time of 300 seconds exceeded

which was fixed by simply setting in xampp/phpmyadmin/libraries/config.default.php

$cfg['ExecTimeLimit'] = 0;

Setting it to 0 disables execution time limits.

Then, after a while, the import happened without problems.

Worked for me. +1 for well-detailed answer, clear instructions on what to change and how to change – Hamman Samuel Jan 23, 2021 at 5:29 You should edit xampp\phpMyAdmin\config.inc.php instead. The config.default file clearly states "DO NOT EDIT THIS FILE, EDIT config.inc.php INSTEAD" – correctsyntax Sep 9, 2022 at 17:08

I got this error too, and I'm working with ubuntu 20.04 and PHP 8.0 so I solved the problem with these steps:

sudo nano /etc/php/8.0/apache2/conf.d/php.ini

in opened file find upload_max_filesize, post_max_size, max_input_time, max_execution_time by CTRL + w and increase the values like this:

max_execution_time = 3000
upload_max_filesize = 64M
max_input_time = 6000
upload_max_filesize = 64M

save the INI file by CTRL + o and then close that by CTRL + x.

then restart your web server by this command:

sudo service apache2 restart

NOTE: These 4 parameters are not together and you have to find them one by one.

/etc/php/8.1/apache2/conf.d/(my name)_php.ini <-- it may be a bit more in sync with the conf.d strategy to create a new file than to edit an existing one. As if to confirm, the default php.ini was moved out of there. I guess this worked for me because my file in conf.d was loaded after php.ini. – Bob Stein Nov 22, 2022 at 18:07

If you prefer to edit the file php.ini in your favorite editor than the Editor created by MAMP, you would need to stop the Servers first.

Then head to Library->Application Support->appsolute->MAMP PRO->templates->php{version_number}.ini.temp and effect any change you would want to have especially the below

max_execution_time = 3000
max_input_time = 60
memory_limit = 128M
post_max_size = 256M
upload_max_filesize 256M

And also make changes in your PHPMyAdmin if it is what you are using in Cpanel.

$cfg['ExecTimeLimit'] = 300;

Make sure you make a copy of the original file. You can navigate under conf!here

  • Enter in the phpmyadmin container docker exec -it idcontainer /bin/bash
  • Move cd /usr/local/etc/php/
  • Create php.ini file
  • Modify it upload_max_filesize=128M post_max_size=128M max_execution_time=1000
  • Save and restart container.
  • This problem was in a Windows pc, at Linux i didnt need to do this.

    i've docker container, i agree php.ini inside /usr/local/etc/php , already php.ini but continue error incorrect format parameter when import .sql in phpmyadmin – Diego Santa Cruz Mendezú Jan 9, 2021 at 5:49 Diego, that was probably b/c there are additional configuration files that are read after the initial php.ini file. Look at the ones in /usr/local/etc/php.d/*.ini. php.net/configuration.file – Tim Apr 5, 2021 at 2:16

    Note: If you're using MAMP you MUST edit the file using the built-in editor.

    Select PHP in the languages section (LH Menu Column) Next, in the main panel next to the default version drop-down click the small arrow pointing to the right. This will launch the php.ini file using the MAMP text editor. Any changes you make to this file will persist after you restart the servers.

    Editing the file through Application->MAMP->bin->php->{choosen the version}->php.ini would not work. Since the application overwrites any changes you make.

    Needless to say: "Here be dragons!" so please cut and paste a copy of the original and store it somewhere safe in case of disaster.enter image description here

    I was able to resolve this by following the steps posted here: xampp phpmyadmin, Incorrect format parameter

    Because I'm not using XAMPP, I also needed to update my php.ini.default to php.ini which finally did the trick.

    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
    
    php_admin_value upload_max_filesize 1028M
    php_admin_value post_max_size 1028M
    php_admin_value max_execution_time 3600
    php_admin_value max_input_time 3600
    

    Type the following command mysql -u username -p -v database_name < "/path/file.sql"

    example : username :root

          password : leave blank
    

    database_name is the database you are importing to (create this database before importing)

    None of the above answers solved it for me.

    I cant even find the 'libraries' folder in my xampp - ubuntu also.

    So, I simply restarted using the following commands:

    sudo service apache2 restart
    
    sudo service mysql restart
    Just restarted apache and mysql. Logged in phpmyadmin again and it worked as usual.
    

    Thanks me..!!