简体   繁体   中英

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

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

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)

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.

如果您使用的是xampp,您可以通过进入xampp控制面板并单击 Apache 前面的config按钮来找到php.ini文件。

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"

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(ie 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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM