phpmyadmin "no data received to import" error, how to fix? - mysql

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

Related

Mediawiki 1.39.1 issue with upload size

All,
I just moved Mediawiki from a hosting provider installation on my own server (local installation). So far it is working, but I have smaller issues like the upload size of files.
By checking in the web I found out that size limits are configured at the php.ini file (+ LocalSettings.php) and the variables for it are (which I would like to set to 2048 MB like below):
post_max_size = 2048M
upload_max_filesize = 2048M
After I configured that I restarted my apache2, but still at the Mediawiki upload page 8 M is shows as the limit and if i try to upload a file which is a bit over 10 MB I get an advice that it is to big. Additional I would like to add that I set in the Mediawiki config file LocalSettings.php the variable:
$wgMaxUploadSize = 2147483648;
But still no change!
Maybe someone has an idea about this issue?
Thanks and regards
wolpi
My idea was to add as a simple comment, but I do not have enough points yet :-)
Have a look here : https://www.mediawiki.org/wiki/Manual:Configuring_file_uploads for some other suggestions.
Also Adam's suggestion might be a thing. If you use WAMP or MAMP you might have more than one ini files.

How to edit the php.ini file in Ubuntu 19.04 (Disco Dingo)

Consider:
Now I am getting this error. How can I resolve this issue?
I found found some related issue, but that told me change max-size inside file php.ini, so how can I edit file php.ini (phpmyadmin-config)?
Importing into MySQL, the database size is above 100 MB. And the MySQL database size converts it into a ZIP file, and then import working, but it is not inserting all tables.
I'm not sure which OS or Apache server you're using right now.
If you are not aware of the php.ini file path then create one info.php file inside your www/htdocs folder and write the below line of code inside that file.
<?php echo phpinfo(); ?>
Execute the above file in your web browser. You will find the loaded php.ini configuration file path, like shown below.
Now go to the file path and increase the values of the below two variables as per your need.
upload_max_filesize=128M
post_max_size=128M
PS: Don't forget to restart your Apache server. :)
The configuration file is located at the below path:
/etc/php/php_version/apache2/php.ini
Now increase the value of:
post_max_size = 150MB
upload_max_size = 150MB
Then restart the server:
sudo service apache2 restart

phpMyAdmin - Error > Incorrect format parameter?

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

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.

Error Code:1262 when loading to mySQL

I have a little bit of an issue when trying to load tsv file 2gb to mysql database. Error Code:1262
As this is quite big file how can i open/change so i can load it into the system?
this will be csv file and as you aware that it is to big.
if you are in local server you can change in .ini file and increase the limit for uploading file and if you are using web server add in .htaccess file
in the .htcaccess file add the following:
php_value upload_max_filesize 500M
php_value post_max_size 500M
in php.ini add:
upload_max_filesize = 500M
post_max_size = 500M
or you can split your csv file