php 如何增加 phpmyadmin 的内存大小
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4859833/
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
How to increase memory size for phpmyadmin
提问by Chauhan
I am facing some problem when I am trying to import magento database on localhost. It just import 18 table but in actual it contain 383 approx table. It gives error given below
当我尝试在本地主机上导入 magento 数据库时遇到了一些问题。它只是导入 18 个表,但实际上它包含 383 个大约表。它给出了下面给出的错误
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 2089674 bytes) in /usr/share/phpmyadmin/libraries/import.lib.php on line 253
致命错误:第 253 行的 /usr/share/phpmyadmin/libraries/import.lib.php 中允许的内存大小为 16777216 字节(试图分配 2089674 字节)
How this problem will configure.
Is there need to change php.ini
?
这个问题将如何配置。有没有必要改变php.ini
?
回答by ayush
use this :
用这个 :
c:\mysql\bin\> mysql -u username -p password database_name < filename.sql
to import using command line
使用命令行导入
or in php.ini
或在 php.ini
memory_limit = 256M
change this to some other larger value. But as Dan said using command line is preferable.
将其更改为其他更大的值。但正如丹所说,最好使用命令行。
回答by Wandering Zombie
phpMyAdmin has been blowing memory limits on me lately (and I wasn't even importing/executing large amounts of data) so I've just tried the following in my config.inc.php
phpMyAdmin 最近一直在对我进行内存限制(我什至没有导入/执行大量数据)所以我刚刚在我的 config.inc.php 中尝试了以下内容
$cfg['MemoryLimit'] = '128M';
https://docs.phpmyadmin.net/en/latest/config.html#cfg_MemoryLimit
https://docs.phpmyadmin.net/en/latest/config.html#cfg_MemoryLimit
回答by Adrian P.
Try this http://dev.mysql.com/doc/refman/5.5/en/mysqlimport.htmlI was capable to import a 930 MB database.
试试这个http://dev.mysql.com/doc/refman/5.5/en/mysqlimport.html我能够导入一个 930 MB 的数据库。
回答by fandasson
You can change php.ini as other answers have mentioned. It can be ok on you localhost. But on webserver with more virtualhost you probably don't want to increase memory limit for all hosts (that's what directive in php.ini does).
您可以像其他答案提到的那样更改 php.ini。在你的本地主机上没问题。但是在具有更多虚拟主机的网络服务器上,您可能不想增加所有主机的内存限制(这就是 php.ini 中的指令所做的)。
To increse memory limit only for given virtualhost edit virtualhost settings. For example:
仅为给定的虚拟主机增加内存限制,请编辑虚拟主机设置。例如:
<VirtualHost *:443>
#your virtualhost settings
php_value memory_limit 64M #place any number you need
</VirtualHost>
Or, you can place the same php_value into your .htaccess file, but your virtualhost must allow to change this values.
或者,您可以将相同的 php_value 放入 .htaccess 文件中,但您的虚拟主机必须允许更改此值。
回答by ppiatek
I was the same problem with the migration of database.
我在迁移数据库时遇到了同样的问题。
Try to change configuration of export to build file with queries like this:
尝试使用如下查询更改导出配置以构建文件:
INSERT INTO tbl_name VALUES (1,2,3)
When I was creating queries like this one:
当我创建这样的查询时:
INSERT INTO tbl_name (col_A,col_B) VALUES (1,2,3), (4,5,6), (7,8,9)
queries were too big to allocate them in memory. When I changed it, there were a lot of small queries so there wasn't problem with memory.
查询太大而无法在内存中分配它们。当我更改它时,有很多小查询,因此内存没有问题。
回答by Lakhan Sharma
In my case, it works by specifying pcre.jit=0
in the file php.ini
.
在我的情况下,它通过pcre.jit=0
在文件中指定来工作php.ini
。
回答by neha
Use this :
用这个 :
Edit your php.ini file: Change
编辑您的 php.ini 文件:更改
memory_limit = 256M