MySQL phpmyadmin“未收到要导入的数据”错误,如何解决?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1149757/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 13:41:59  来源:igfitidea点击:

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

mysqlphpmyadminxampp

提问by kevtrout

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.

我在电脑上使用 XAMPP 来托管数据库。我使用phpmybackuppro导出了一个备份(“bintra.sql”)。我在家里的 mac 上使用 xampp,当我尝试导入位于桌面上的 sql 文件时,出现此错误。

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.

现在,bintra.sql 的文件大小为 922kb。phpmyadmin 屏幕上显示的最大允许大小为 3,072KiB,所以我认为这不是阻止导入的大小。

I'm using phpmyadmin v2.11.7

我正在使用 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

这些是我从 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.

尝试使用 Mamp 代替。使用相同的 sql 文件可以正常工作。我不知道为什么。

采纳答案by Frederik Slijkerman

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.

我在 Windows 上遇到了同样的问题。原来它是由 PHP 用于上传的临时目录引起的。默认情况下,这是 C:\Windows\Temp,PHP 不可写。

In php.ini, add:

在 php.ini 中,添加:

upload_tmp_dir = C:\inetpub\temp

Make sure to remove any other upload_tmp_dirsettings. Set permissions on C:\inetpub\tempso IUSRand IIS_IUSRShave write permission. Restart the web server and you should be fine.

确保删除任何其他upload_tmp_dir设置。在C:\inetpub\tempso上设置权限IUSRIIS_IUSRS具有写入权限。重新启动 web 服务器,你应该没问题。

回答by mohammad

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

然后重启你的xampp或者wamp生效

or stop then start only apache in xammp

或停止然后仅在 xammp 中启动 apache

回答by jmarceli

Check permissions for you upload directory. You can find its path inside /etc/phpmyadmin/apache.conffile.

检查您上传目录的权限。您可以在/etc/phpmyadmin/apache.conf文件中找到它的路径。

In my case (Ubuntu 14.04) it was:

在我的情况下(Ubuntu 14.04)它是:

php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp

So I checked permissions for /var/lib/phpmyadmin/tmpand 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.

因此,我检查了权限,/var/lib/phpmyadmin/tmp结果发现该目录对于我的 Apache 用户不可写(默认情况下为www-data)。可能是这种情况,尤其是如果您像我一样更改了 apache 用户。

回答by TechHelix

Open your php.ini file use CNTRL+F to search for the following settings which may be the culprit:

打开你的 php.ini 文件,使用 CNTRL+F 搜索以下可能是罪魁祸首的设置:

  • file_uploads
  • upload_max_filesize
  • post_max_size
  • memory_limit
  • max_input_time
  • max_execution_time
  • 文件上传
  • 上传最大文件大小
  • post_max_size
  • 内存限制
  • 最大输入时间
  • 最大执行时间

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.

确保在进行更改之前保存 php.ini 的副本。您需要调整设置以适应您的文件大小,并增加输入和/或执行时间。

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

来源:http: //forum.wampserver.com/read.php?2,20757,20935

回答by Pramod Jain

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

回答by Udhav Sarvaiya

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.

没有收到要导入的数据。没有提交文件名,或者文件大小超过了 PHP 配置允许的最大大小。参见常见问题 1.16。

Solution:

解决方案:

A solution is easy, Need to increase file size upload limit as per your requirement.

解决方案很简单,需要根据您的要求增加文件大小上传限制

First of all, stopthe XAMPP/Wampand then find the php.iniin the following locations. Windows: C:\xampp\php\php.ini

首先,停止XAMPP / WAMP然后找到php.ini在以下位置。Windows:C:\xampp\php\php.ini

Open the php.inifile. Find these lines in the php.inifile and replace it following numbers

打开php.ini文件。在php.ini文件中找到这些行并将其替换为以下数字

upload_max_filesize = 64M

And then restartyour XAMPP/Wamp

然后重启你的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)

注意:对于 Windows,您可以在C:\xampp\php\php.ini-Folder (Windows) 或 etc-Folder(在 xampp-Folder 内)中找到该文件

回答by Waqar Detho

If you are using xamppyou can find php.inifile by going into xamppcontrol paneland and clicking configbutton in front of Apache.

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

回答by Ramesh Kumar Maurya

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.

没有收到要导入的数据。没有提交文件名,或者文件大小超过了 PHP 配置允许的最大大小。参见常见问题 1.16。

这些是我从 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".

在这里你可以设置任何可以保存临时文件的目录,我已经安装在 D: 驱动器 xampp 中,所以我将其设置为“D:\xampp\xampp\tmp”。

回答by Utsav

Change your upload settings in php.ini configuration file

在 php.ini 配置文件中更改您的上传设置

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

回答by Bassel Safadi

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:

我从来没有成功地使用 phpmyadmin 或 phpMyBackupPro 导入哑文件,最好是转到控制台或命令行(无论在 mac 中调用什么)并执行以下操作:

mysql -u username -p databasename

mysql -u 用户名 -p 数据库名

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

用你用来连接mysql的用户名替换用户名,然后它会要求你输入那个用户名的密码,就是这样

you can import any size of dumb using this method

您可以使用此方法导入任何大小的哑巴