phpMyAdmin - Error > Incorrect format parameter? - mysql
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!
If you use docker-compose just set UPLOAD_LIMIT
phpmyadmin:
image: phpmyadmin/phpmyadmin
environment:
UPLOAD_LIMIT: 1G
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.
Without any problems, I imported directly from the command line.
mysql -uroot -hURLServer -p DBName< filename.sql
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
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.
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.
On the command line use
C:\Windows\system32> mysql -u root -p
mysql> use desired_db;
mysql> source db_backup.sql;
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.
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.
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!
You can use xampp shell
Open Xampp and click shell
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)
Solved! with 2 simple steps.
in php.ini
max_execution_time = 600
max_input_time = 600
memory_limit = 1024M
post_max_size = 1024M
my.ini
max_allowed_packet = 1024M
If You are using wampp and windows 11
open folder
C:\wamp64\alias\phpmyadmin.conf
update values
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
to
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
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.
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.
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..!!
Related
Changing innodb_log_file_size in Ubuntu 14.04 LTS
I am a starter in Linux and am hence new to all this. Please take my noob mistakes kindly if there are any. So I am installing OTRS in Linux for which I have to change the innodb_log_file_size to 512M So I did the following but have been unsuccessful to change the log_file_size. Set GLOBAL innodb_fast_shutdown to 1 Ensured that shutdown was completed using log file (It did indeed, saw a line which said Shutdown complete) Moved the following files to home logfile0 & logfile1 from cd /var/lib/mysql Nano edited the my.cnf in ` /etc/mysql/my.cnf I added the following line under [mysqldump] inno_db_log_file_size = 512M Saved and closed the .cnf file and restarted mysql server using /etc/init.d/mysql start I then checked the error log file and found that the logfile0 & logfile1 got recreated but got recreated with 5MB size again Can someone tell me what I am doing wrong. I am guessing that I am not adding the inno_db_log_file_size = 512M in the right place. P.S: There was no inno_db_log_file_size line before I added it. Thanks in advance. `
The config option is innodb_log_file_size or innodb-log-file-size (- and _ are both valid), but not inno_db_log_file_size.
Actually that is what I added. I figured out where to write the line. The above was just a typo. Thanks for looking into it.:) I solved it myself. Cheers.
Why can't I change sql_mode permanently?
I an currently using mysql server 5.6 in windows 10. while using mysql, an error keeps appearing that goes as something like this "the following column does not have a default value" i read on the internet that i can solve this problem if i change the sql_mode. It is currently set to sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES I took this from "my-default.ini" file in "mysql server 5.6" folder. I read several other answers that say that if you want to permanently change your sql_mode, you should do it through the "my-default.ini" file. So what i did was, i run my notepad as administrator, then i browsed to open "my-default.ini" file that is found in: c:\programs files (x86)\mysql\mysql server 5.6\my-default.ini when i opened the file, i modified the last line: sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES to sql_mode= then i saved the file, closed it. then by using task manager i restarted my sql sever: task manager >> services >> mysql56 This is the whole process that should permanently modify my sql_mode. when i look in my "my-default.ini" file, the last line is still modified. but if i log into mysql through the command line and view my sql_mode with the following code: select ##sql_mode; I get that my sql_mode is STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION I want all this to be removed (permanently) in order for my error to disappear. IF i try to modify the sql_mode from the command line by using: set ##global.sql_mode=""; It worked, but when i restarted MySQL, everything was back as it was before. Can someone please tell me what i am doing wrong? and if there is another way to solve this problem.
UPDATE: Sorry, forgot you were using Windows 10. I'm not sure how to deal with this issue in Windows but maybe try copying my-default.ini to my.ini and changing that setting. Sorry for confusion. Not sure if you can set your sql_mode to nothing but try changing the value in your /etc/mysql/my.cnf file. If that folder/file doesn't exist, create it and try setting sql_mode under [mysqld] like this: [mysqld] sql_mode= I just did this same thing only I set the sql_mode to NO_ENGINE_SUBSTITUTION.
If you have MySQL Workbench installed, check the Server Status for the base directory of your instance. You should find a my.ini file there that keeps your changes.
sql_mode need to add to file /etc/init.d/mysql as a argument to start like: $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" --sql-mode="" $other_args >/dev/null 2>&1 & Restart MySQL database server to apply new config.
In MYSQL 8 and ubuntu server 20.xx I had to add: sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTIO To file /etc/mysql/mysql.conf.d/mysqld.cnf In order that the setting stay persistent after server restart Disclaimer: this was the only place it actually worked, I have no idea what's the good practice where to add these custom settings but it 'ain't stupid if it works'. Somebody can tell me. I tried the other options I found on forums: my.cnf did not work creating custom cnf did not work adding it to mysql.cnf did not work
Setting `server-id` variable in MySQL doesn't work
I've been trying to set up two databases as master & slave. I followed the famous guide here: https://dev.mysql.com/doc/refman/5.1/en/replication-howto-existingdata.html But no luck on my slave server, The issue I'm having is setting the server-id variable. No matter where I define it (I looked into all the possible cnf files that might allow me to define the variable) I tried to define it like so: [mysqld] server-id = 2 I also tried setting it by using SET GLOBAL server_id but obviously, it didn't save the setting. when I do: SHOW VARIABLES LIKE 'server_id' It returns server_id 0 Among the cnf files I've looked into are: etc/mysql/mysql.conf.d/mysqld.cnf etc/mysql/mysql.conf.d/mysqld_safe_syslog.cnf etc/mysql/conf.d/mysql.cnf etc/mysql/debian.cnf etc/mysql/mysql.cnf usr/my.cnf usr/my-new.cnf usr/etc/my.cnf My MySQL server is running on Ubuntu. And if it matters, I start it by typing: service mysql start I'd love to know where else I could look to fix this issue. Thanks a bunch! Additional Notes: MySQL Ignoring the global conf file I received this warning a couple of times and it disappeared when I returned the chmod to 644 on the etc/mysql folder, although every thing stated above was attempted using both 644 and 777 permissions, with 644 the warning disappears.
I know it's to late, but for those who will make the mistake. It's server_id and not server-id: [mysqld] server_id = 2
For me it worked by renaming the from /etc/mysql/conf.d/my.cnf to /etc/mysql/conf.d/my.ini I'm not sure of the exact reason for that (feel free to edit this answer and add to it). I tried out various combinations: Keeping the variable as: server-id and server_id Keeping the group/section as: [mysql] and [mysqld] Renaming the file to: my.cnf , mysqld.cnf, mysql.cnf, my.ini You can keep trying various combinations out of the above options, it should definitely work. :)
Trying to increase file upload limit for phpmyadmin
I'm having an issue with phpmyadmin where the max file upload size stays constant at 128MiB. I have read other issues extensively and have already run phpinfo() to make sure i'm loading the right file. The ini files it is loading are: Configuration File (php.ini) Path = C:\Windows Loaded Configuration File = C:\wamp\bin\apache\apache2.4.9\bin\php.ini These files have been updated so that the following parameters are as follows: memory_limit = 1500M upload_max_filesize = 1028M post_max_size = 1028M max_execution_time = 500 Further more the phpinfo() function returns these values for both local and master values. Additonally, I am using wamp server and have not only restarted all the services as well as restarted my computer. Despite this the phpmyadmin file upload function stays at 128MiB. The reason this is an issue is due to the fact the data I need to import is an extremely large .csv the current one is 350MB however I expect to have to import one that is at least 3GB. I'm completely at a loss as to how I should continue with this.
Find the php.ini file. Find this and change it: post_max_size = 128M Change the values of theese like this memory_limit = 2000M post_max_size = 4000M upload_max_filesize = 5000M Restart apache, and you are good to go. EDIT: As you can see, memory_limit is lower than post_max_size that is lower than upload_max_filesize. You need to put values like these in order to workaround upload.
phpmyadmin "no data received to import" error, how to fix?
I am using XAMPP on a pc atwork to host a database. I exported a backup ("bintra.sql") using phpmybackuppro. I use xampp on a mac at home, and when I try to import the sql file located on my desktop, I get this error. No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration. See FAQ 1.16. Now, the file size of bintra.sql is 922kb. The max size allowed indicated on the phpmyadmin screen is 3,072KiB, so I don't think it is the size that is preventing the import. I'm using phpmyadmin v2.11.7 Does anyone have any ideas why no data is being received to import? Comment Responses: These are my upload settings from php.ini ;Whether to allow HTTP file uploads. file_uploads = On ;Temporary directory for HTTP uploaded files (will use system default if not specified). //upload_tmp_dir = ;Maximum allowed size for uploaded files. upload_max_filesize = 3M ;Maximum size of POST data that PHP will accept. post_max_size = 8M EDIT: Tried using Mamp instead. Works fine with the same sql file. I don't know why.
I HAD THE SAME PROBLEM AND THIS WORKED FOR ME : Try these different settings in C:\wamp\bin\apache\apache2.2.8\bin\php.ini Find: post_max_size = 8M upload_max_filesize = 2M max_execution_time = 30 max_input_time = 60 memory_limit = 8M Change to: post_max_size = 750M upload_max_filesize = 750M max_execution_time = 5000 max_input_time = 5000 memory_limit = 1000M Then restart your xampp or wamp to take effect or stop then start only apache in xammp
I had the same problem on Windows. Turns out it was caused by the temporary directory PHP uses for uploads. By default this is C:\Windows\Temp, which is not writable for PHP. In php.ini, add: upload_tmp_dir = C:\inetpub\temp Make sure to remove any other upload_tmp_dir settings. Set permissions on C:\inetpub\temp so IUSR and IIS_IUSRS have write permission. Restart the web server and you should be fine.
Check permissions for you upload directory. You can find its path inside /etc/phpmyadmin/apache.conf file. In my case (Ubuntu 14.04) it was: php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp So I checked permissions for /var/lib/phpmyadmin/tmp and it turns out that the directory wasn't writable for my Apache user (which is by default www-data). It could be the case especially if you changed your apache user like I do.
Open your php.ini file use CNTRL+F to search for the following settings which may be the culprit: file_uploads upload_max_filesize post_max_size memory_limit max_input_time max_execution_time Make sure to save a copy of the php.ini prior to making changes. You will want to adjust the settings to accommodate your file size, and increase input and/or execution time. Remember to restart your services after making changes. Warning! There may be some unforeseen drawbacks if you adjust these settings too liberally. I am not expert enough to know this for sure. Source: http://forum.wampserver.com/read.php?2,20757,20935
It’s a common error and it can be easily fixed. This error message is an indication of that the file you are trying to import is larger than your web host allows No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration. See FAQ 1.16. Solution: A solution is easy, Need to increase file size upload limit as per your requirement. First of all, stop the XAMPP/Wamp and then find the php.ini in the following locations. Windows: C:\xampp\php\php.ini Open the php.ini file. Find these lines in the php.ini file and replace it following numbers upload_max_filesize = 64M And then restart your XAMPP/Wamp NOTE: For Windows, you can find the file in the C:\xampp\php\php.ini-Folder (Windows) or in the etc-Folder (within the xampp-Folder)
xampp in ubuntu cd /opt/lampp/etc vim php.ini Find: post_max_size = 8M upload_max_filesize = 2M max_execution_time = 30 max_input_time = 60 memory_limit = 8M Change to: post_max_size = 750M upload_max_filesize = 750M max_execution_time = 5000 max_input_time = 5000 memory_limit = 1000M sudo /opt/lampp/lampp restart
Kind of cheating I guess...but you can also zip the sql file and then import it. I've had that issue in the past when I was working with forum software and was always a simple fix.
If you are using xampp you can find php.ini file by going into xampp control panel and and clicking config button in front of Apache.
if in any case you haven't found a fix that you needed that were written above, a simple fix is to zip your .sql file and import the zipped file on phpMyAdmin. This should work as long as the zip file size would not be more than the maximum upload bytes in your phpMyAdmin
I never succeeded importing dumb files using phpmyadmin or phpMyBackupPro better is to go to console or command line ( whatever it's called in mac ) and do the following: mysql -u username -p databasename replace username with the username you use to connect to mysql, then it will ask you to enter the password for that username, and that's it you can import any size of dumb using this method
No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration. See FAQ 1.16. These are my upload settings from php.ini upload_tmp_dir = "D:\xampp\xampp\tmp" ;//set these for temp file storing ; Maximum allowed size for uploaded files. ; http://php.net/upload-max-filesize upload_max_filesize = 10M ;//change it according to max file upload size I am sure your problem will be short out using this instructions. upload_tmp_dir = "D:\xampp\xampp\tmp" Here you can set any directory that can hold temp file, I have installed in D: drive xampp so I set it "D:\xampp\xampp\tmp".
Change your upload settings in php.ini configuration file Change the below settings to these values: Change to: post_max_size = 750M upload_max_filesize = 750M max_execution_time = 5000 max_input_time = 5000 memory_limit = 1000M
just copy your source DataBase(from your PC C:\xampp\mysql\data\"your data base"), then copy it to the destination folder in your MAC (/Application/Xampp/xamppfiles/var/mysql). don't forget to set the permission of the new copied folder(your DataBase) in your MAC otherwise you can't see your tables! to set the permission: -go to the folder of your DataBase(/Application/Xampp/xamppfiles/var/mysql/"your data base") -right click on it -select Get info -in the sharing&permissions you must add your user account(i.e. administrator or everyone) -choose its privilege to Read & Write -choose Apply to enclosed items enjoy your Database ;)
if none of the above solutions worked for you. in my case phpmyadmin was using a deferent configuration file(php.ini). to know what config file used by phpmyadmin : go /usr/share/phpmyadmin then edit index.php file and make it start with this <?php phpinfo(); die(); // ... now when you visit localhost/phpmyadmin you can search for php.ini. you can tell where the config file is , in my case it was /etc/php/7.3/apache2/php.ini now you need to update upload_max_filesize and post_max_size and you may need to change upload_tmp_dir save your changes and then run sudo service apache2 restart now everything should be OK
I tried all these answer but none succeed. even with heidisql Then I open my.ini files it turned out this line performance_schema = off So I turned it on, performance_schema = on, the importing with heidisql works, but phpmyadmin still not woking Finally I update phpmyadmin to the latest version (ver 5.2 at this time), and it works, importing works again