phpMyAdmin - Error > Incorrect format parameter?

DatabaseMysql

Database Problem Overview


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

Database Solutions


Solution 1 - Database

This issue is not because of corrupt database. I found the solution from this video - https://www.youtube.com/watch?v=MqOsp54EA3I

It is suggested to increase the values of two variables in php.ini file. Change following in php.ini

upload_max_filesize=64M
post_max_size=64M

Then restart the server.

This solved my issue. Hope solves yours too.

Solution 2 - Database

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).

Solution 3 - Database

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.

Solution 4 - Database

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!

Solution 5 - Database

If you use docker-compose just set UPLOAD_LIMIT

phpmyadmin:
    image: phpmyadmin/phpmyadmin
    environment:
        UPLOAD_LIMIT: 1G

Solution 6 - Database

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

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

config.default.php

$cfg['ExecTimeLimit'] = 0;

Setting it to 0 disables execution time limits.

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

Solution 7 - Database

Without any problems, I imported directly from the command line.

mysql -uroot -hURLServer -p DBName< filename.sql

Solution 8 - Database

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.

Solution 9 - Database

I had this problem but with a docker container (phpmyadmin users),

Solution:

  • 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.

Solution 10 - Database

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

Solution 11 - Database

I was able to resolve this by following the steps posted here: https://stackoverflow.com/questions/50201874/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.

Solution 12 - Database

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 image description here

Solution 13 - Database

On the command line use

C:\Windows\system32> mysql -u root -p

mysql> use desired_db;
mysql> source db_backup.sql;

Solution 14 - Database

This error is caused by the fact that the maximum upload size is (Max: 2,048KiB). If your file is bigger than this, you will get an error. Zip the file and upload it again, you will not get the error.

Solution 15 - Database

I had this error and as I'm on shared hosting I don't have access to the php.ini so wasn't sure how I could fix it, the host didn't seem to have a clue either. In the end I emptied my browser cache and reloaded phpmyadmin and it came back!

Solution 16 - Database

If you can't upload import file due to big size and you can't modify parameters because you are in a shared hosting try to install on your computer HeidiSQL and load file from there.

Solution 17 - Database

This tends to occur when you change the PHP settings as mentioned here and continue to import the database without first restarting Apache. That causes the error to be triggered.

Solution 18 - Database

You can use xampp shell

  1. Open Xampp and click shell enter image description here

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)

Solution 19 - Database

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

and

sudo service mysql restart

Just restarted apache and mysql. Logged in phpmyadmin again and it worked as usual.

Thanks me..!!

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionHenryView Question on Stackoverflow
Solution 1 - DatabasePooja MistryView Answer on Stackoverflow
Solution 2 - DatabaseDesign.GardenView Answer on Stackoverflow
Solution 3 - DatabaseMartin NView Answer on Stackoverflow
Solution 4 - DatabasePedro Araujo JorgeView Answer on Stackoverflow
Solution 5 - DatabaseEugeneView Answer on Stackoverflow
Solution 6 - DatabaseTiago Martins PeresView Answer on Stackoverflow
Solution 7 - DatabaseKairat KoibagarovView Answer on Stackoverflow
Solution 8 - DatabasePejman KheyriView Answer on Stackoverflow
Solution 9 - DatabaseSchwarz54View Answer on Stackoverflow
Solution 10 - Databaseuser432350View Answer on Stackoverflow
Solution 11 - DatabaseChantel GonzalesView Answer on Stackoverflow
Solution 12 - DatabasepensebienView Answer on Stackoverflow
Solution 13 - DatabaseSwaleh MatongwaView Answer on Stackoverflow
Solution 14 - Databaseto240View Answer on Stackoverflow
Solution 15 - DatabaseHelen LeeView Answer on Stackoverflow
Solution 16 - DatabaseKike LebowskiView Answer on Stackoverflow
Solution 17 - DatabaseDanstan OnguboView Answer on Stackoverflow
Solution 18 - DatabaseHerbertView Answer on Stackoverflow
Solution 19 - DatabaseDeepak KeynesView Answer on Stackoverflow