php 如何在phpmyadmin中导入表?我收到文件大小错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8644872/
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-26 05:09:23  来源:igfitidea点击:

How to import table in phpmyadmin? I got error of file size

phpphpmyadmin

提问by User1988

I want to import database in phpmyadmin but i got error like this... "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."

我想在 phpmyadmin 中导入数据库,但出现这样的错误...“没有收到要导入的数据。要么没有提交文件名,要么文件大小超过了 PHP 配置允许的最大大小。”

my file size is 4.8 mb,

我的文件大小是 4.8 MB,

please give me solution....

请给我解决方案....

回答by Shreekanth Gaanji

Follow theses steps

按照这些步骤

Go to the PHP folder -> search for php.ini

转到 PHP 文件夹 -> 搜索 php.ini

Seach for the below line and change it according to your need.

搜索以下行并根据您的需要进行更改。

; Maximum allowed size for uploaded files.
upload_max_filesize = 2M

Restart the server to confirm changes.

重新启动服务器以确认更改。

回答by jogesh_pi

try to edit after change into php.ini :

更改为 php.ini 后尝试编辑:

upload_max_filesize = 10M 
post_max_size = 20M 
memory_limit = 128M

also change the value of max_execution_time

也改变了价值 max_execution_time

EDIT: if you want then do all that stuff with command line:

编辑:如果你想然后用命令行做所有这些事情:

mysql -h[Host Name] -u[User Name] [Database Name]<[SQL File Name] -p

through this you will import the database..

通过这个,你将导入数据库..

回答by Gopesh

You need to edit the php.ini file for changing the file size. the line is

您需要编辑 php.ini 文件以更改文件大小。这条线是

upload_max_filesize = 2M

上传最大文件大小 = 2M

You need to change the file size that you need to import.For ex: if you need to import a 10 mb file,then change it into

您需要更改您需要导入的文件大小。例如:如果您需要导入一个 10 mb 的文件,则将其更改为

upload_max_filesize = 10M

upload_max_filesize = 10M

Then restart your server.

然后重启你的服务器。

回答by Snehal Bhusal

I had the same problem. Here is the solution:

我有同样的问题。这是解决方案:

you need to edit the variable for max_upload_sizein php.inifile so do the following:

你需要编辑的变量max_upload_sizephp.ini文件中,以便做到以下几点:

locate php.ini

找到 php.ini

it will show you the location of that file

它会告诉你那个文件的位置

enter the file by

通过输入文件

sudo gedit /etc/php/7.0/apache2/php.ini

enter password

输入密码

find the variable and edit the value to as much as you want save it and exit now restart your server service apache2 restartand done!!

找到变量并将值编辑为您想要的大小,保存并退出现在重新启动您的服务器 服务 apache2 重新启动并完成!!

回答by Sonal Khunt

Copy the data from the file, put it into the sql tab of phpmyadmin, and press the "Go" button.

从文件中复制数据,放入phpmyadmin 的sql 选项卡中,然后按“Go”按钮。

回答by Little Brain

You need to make sure that your file size options are set to suitable values in the correct file. On my system there are 3 files called php.ini inside /etc/php/7.0 (Linux Mint 18.1 Cinnamon) but only one of them is being used.

您需要确保在正确的文件中将文件大小选项设置为合适的值。在我的系统上,/etc/php/7.0(Linux Mint 18.1 Cinnamon)中有 3 个名为 php.ini 的文件,但只有其中一个正在使用。

The instructions heretell you how to find which file to edit:

此处的说明告诉您如何查找要编辑的文件:

Create a file var/www/html/phpinfo.php. Paste this code into it and save it:

创建一个文件 var/www/html/phpinfo.php。将此代码粘贴到其中并保存:

<?php phpinfo() ?>

Then in a browser navigate to http://localhost/phpinfo.php

然后在浏览器中导航到http://localhost/phpinfo.php

This displays your php configuration, look for the option "Loaded Configuration File", it should be near the top of the page. This will give you the location of your php.ini file, on my system it's /etc/php/7.0/apache2/php.ini

这将显示您的 php 配置,查找选项“加载的配置文件”,它应该位于页面顶部附近。这将为您提供 php.ini 文件的位置,在我的系统上它是 /etc/php/7.0/apache2/php.ini

Now open that file (don't forget to open it as root so you can save changes) and increase the allowed file size to a value larger than your sql file, for example:

现在打开该文件(不要忘记以 root 身份打开它以便您可以保存更改)并将允许的文件大小增加到大于您的 sql 文件的值,例如:

upload_max_filesize = 20M

If that doesn't do the trick, you can try increasing the values for these settings also:

如果这不起作用,您也可以尝试增加这些设置的值:

max_execution_time
max_input_time
memory_limit
post_max_size

回答by Daminda Herath

If you are using XAMPP in Ubuntu

如果您在 Ubuntu 中使用 XAMPP

Follow theses steps

按照这些步骤

/opt/lampp/etc/php.ini

/opt/lampp/etc/php.ini

Seach for the below line and change it according to your need.

搜索以下行并根据您的需要进行更改。

; Maximum allowed size for uploaded files. upload_max_filesize = 2M

; 上传文件的最大允许大小。上传最大文件大小 = 2M

回答by score

I had the same problem with WAMP. I even tried changing the limit going back to php.ini for max_upload_limit but still it didn't work. I went back to my mac and tried on MAMP and i had no issues at all. BTW I figured out that... the max limit size set in WAMP is 2084KiB where as in MAMP is 32MiB. If you even refer to the documentation from PHP in the FAQ_16 it talks about the max_upload_limit in php.ini. Documentation.html#faq1_16 a very userful link is below: http://www.magentocommerce.com/wiki/magento_filesystem_permissions

我在 WAMP 上遇到了同样的问题。我什至尝试将 max_upload_limit 的限制更改回 php.ini,但仍然没有用。我回到我的 Mac 并尝试使用 MAMP,我完全没有问题。顺便说一句,我发现... WAMP 中设置的最大限制大小为 2084KiB,而 MAMP 中设置的最大限制大小为 32MiB。如果您甚至参考 FAQ_16 中的 PHP 文档,它就会谈到 php.ini 中的 max_upload_limit。Documentation.html#faq1_16 一个非常有用的链接如下:http: //www.magentocommerce.com/wiki/magento_filesystem_permissions

回答by Muhammad Usman

Increase the upload file size limit in the server. If you don't have access to it try breaking the file into parts, for different tables. Or you may use MySQL Dumper.

增加服务器中的上传文件大小限制。如果您无权访问它,请尝试将文件分成几部分,用于不同的表。或者您可以使用MySQL Dumper

回答by pascal mutulu

In Ubuntu 18.04 apache2does change the upload size on the below php.inifile :

在 Ubuntu 中,18.04 apache2确实更改了以下php.ini文件的上传大小:

root@xxxxxxxxxx:/etc/php/7.2/apache2# pwd
/etc/php/7.2/apache2
root@xxxxxx:/etc/php/7.2/apache2# vi php.ini