phpmyadmin“没有收到要导入的数据” 错误,如何修复?
我在工作电脑上使用 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.
现在,bintra.sql的文件大小为922kb。 phpmyadmin 屏幕上显示的允许最大大小是 3,072KiB,因此我认为该大小不会阻止导入。
我正在使用 phpmyadmin v2.11.7
有谁知道为什么没有收到要导入的数据?
评论响应:
这些是我在 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
编辑:
尝试使用 Mamp 代替。 使用相同的 sql 文件可以正常工作。 我不知道为什么。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(15)
我在 Windows 上也遇到了同样的问题。 原来这是由 PHP 用于上传的临时目录引起的。 默认情况下,这是 C:\Windows\Temp,对于 PHP 来说不可写。
在 php.ini 中,添加:
确保删除任何其他
upload_tmp_dir
设置。 设置C:\inetpub\temp
的权限,以便IUSR
和IIS_IUSRS
具有写入权限。 重新启动网络服务器就可以了。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:
Make sure to remove any other
upload_tmp_dir
settings. Set permissions onC:\inetpub\temp
soIUSR
andIIS_IUSRS
have write permission. Restart the web server and you should be fine.检查您上传目录的权限。 您可以在
/etc/phpmyadmin/apache.conf
文件中找到它的路径。就我而言(Ubuntu 14.04)是:
所以我检查了
/var/lib/phpmyadmin/tmp
的权限,结果发现该目录对于我的 Apache 用户是不可写的(默认情况下)www-data
)。 情况可能如此,尤其是如果您像我一样更改了 apache 用户。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:
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 defaultwww-data
). It could be the case especially if you changed your apache user like I do.打开 php.ini 文件,使用 CNTRL+F 搜索以下可能是罪魁祸首的设置:
确保在进行更改之前保存 php.ini 的副本。 您将需要调整设置以适应您的文件大小,并增加输入和/或执行时间。
请记住在进行更改后重新启动您的服务。
警告!如果您过于随意地调整这些设置,可能会出现一些不可预见的缺点。 我不够专业,无法确定这一点。
资料来源: http://forum.wampserver.com/read.php?2,20757 ,20935
Open your php.ini file use CNTRL+F to search for the following settings which may be the culprit:
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 /Wamp,然后在以下位置找到
php.ini
。 Windows:C:\xampp\php\php.ini打开
php.ini
文件。 在php.ini
文件中找到这些行并将其替换为以下数字,然后重新启动您的XAMPP/Wamp
注意: 对于 Windows,您可以在 C:\xampp\php\php.ini-文件夹 (Windows) 或 etc-文件夹(在 xampp 内)中找到该文件-文件夹)
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
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.iniOpen the
php.ini
file. Find these lines in thephp.ini
file and replace it following numbersAnd 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)
我猜有点作弊...但你也可以压缩 sql 文件然后导入它。 我过去在使用论坛软件时遇到过这个问题,而且总是一个简单的修复。
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.
如果在任何情况下您都没有找到上面所写的所需修复,一个简单的修复就是压缩您的 .sql 文件并将压缩文件导入 phpMyAdmin。
只要 zip 文件大小不超过 phpMyAdmin 中的最大上传字节数,此操作就应该有效
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
如果您使用的是xampp,您可以通过进入xampp控制面板并单击<来找到
php.ini
文件Apache 前面的 code>config 按钮。If you are using xampp you can find
php.ini
file by going into xampp control panel and and clickingconfig
button in front of Apache.我从未成功使用 phpmyadmin 或 phpMyBackupPro 导入哑文件
更好的方法是转到控制台或命令行(无论在 mac 中如何称呼)并执行以下操作:
mysql -u 用户名 -p 数据库名称
将 username 替换为您用于连接 mysql 的用户名,然后它会要求您输入该用户名的密码,就这样
您可以使用此方法导入任何大小的哑文件
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
未收到要导入的数据。 没有提交文件名,或者文件大小超出了 PHP 配置允许的最大大小。 请参阅常见问题解答 1.16。
These are my upload settings from php.ini
我相信使用此说明将会解决您的问题。
在这里你可以设置任何可以保存临时文件的目录,我已经安装在D:驱动器xampp所以我将其设置为“D:\xampp\xampp\tmp”。
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
I am sure your problem will be short out using this instructions.
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".
更改 php.ini 配置文件中的上传设置
将以下设置更改为以下值:
更改为:
Change your upload settings in php.ini configuration file
Change the below settings to these values:
Change to:
只需复制您的源数据库(从您的 PC C:\xampp\mysql\data\"您的数据库"),然后将其复制到 MAC 中的目标文件夹(/Application/Xampp/xamppfiles/var/mysql)。
不要忘记在您的 MAC 中设置新复制的文件夹(您的数据库)的权限,否则您将看不到您的表!
设置权限:
-转到您的数据库文件夹(/Application/Xampp/xamppfiles/var/mysql/“您的数据库”)
- 右键单击它
- 选择获取信息
- 在共享和权限中您必须添加您的用户帐户(即管理员或所有人)
-选择其阅读和阅读权限 写
-选择应用于随附的项目,
享受您的数据库;)
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 ;)
如果上述解决方案都不适合您。
在我的例子中,phpmyadmin 使用的是不同的配置文件(php.ini)。 要了解 phpmyadmin 使用的配置文件:
开始
转到
/usr/share/phpmyadmin
然后编辑index.php
文件并使其在访问localhost 时从此 /phpmyadmin
您可以搜索php.ini
。你可以知道配置文件在哪里,在我的例子中它是
/etc/php/7.3/apache2/php.ini
现在你需要更新
upload_max_filesize
和post_max_size
并且您可能需要更改upload_tmp_dir
保存更改,然后运行
sudo service apache2 restart
现在一切都应该没问题
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 editindex.php
file and make it start with thisnow when you visit
localhost/phpmyadmin
you can search forphp.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
andpost_max_size
and you may need to changeupload_tmp_dir
save your changes and then run
sudo service apache2 restart
now everything should be OK
我尝试了所有这些答案,但没有成功。 即使使用 heidisql
然后我打开 my.ini 文件
原来是这一行
所以我打开了它,performance_schema = on,
使用 heidisql 导入有效,但 phpmyadmin 仍然无法启动
最后我将 phpmyadmin 更新到最新版本(此时为 5.2 版),并且它有效,导入再次有效
I tried all these answer but none succeed. even with heidisql
Then I open my.ini files
it turned out this line
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
我遇到了同样的问题,这对我有用:
然后重新启动您的 xampp 或 wamp 以生效
或停止然后仅在 xammp 中启动 apache
I HAD THE SAME PROBLEM AND THIS WORKED FOR ME :
Then restart your xampp or wamp to take effect
or stop then start only apache in xammp