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