当我的意思是“大”时,它只有~25000行
...
我有一个重量为 5 Mb
的大表,当尝试列出所有数据并查看信息时,PhpMyAdmin 显示以下错误:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 29050028 bytes) in /Library/WebServer/Documents/phpmyadmin/libraries/DisplayResults.class.php on line 2561
只有 25K
行,超过 100K
会怎样?
我在网上查找了如何修复它,并将 PHP.ini
中的资源限制提高到:
;;;;;;;;;;;;;;;;;;; ; Resource Limits ; ;;;;;;;;;;;;;;;;;;;
; Maximum execution time of each script, in seconds ; http://php.net/max-execution-time ; Note: This directive is hardcoded to 0 for the CLI SAPI max_execution_time = 1000
; Maximum amount of time each script may spend parsing request data. It's a good ; idea to limit this time on productions servers in order to eliminate unexpectedly ; long running scripts. ; Note: This directive is hardcoded to -1 for the CLI SAPI ; Default Value: -1 (Unlimited) ; Development Value: 60 (60 seconds) ; Production Value: 60 (60 seconds) ; http://php.net/max-input-time max_input_time = 1000
; Maximum input variable nesting level ; http://php.net/max-input-nesting-level ;max_input_nesting_level = 64
; How many GET/POST/COOKIE input variables may be accepted max_input_vars = 10000
; Maximum amount of memory a script may consume (128MB) ; http://php.net/memory-limit memory_limit = 128M
但是什么都没有改变。
请帮忙。
谢谢
最佳答案
您收到此错误
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 29050028 bytes) in /Library/WebServer/Documents/phpmyadmin/libraries/DisplayResults.class.php on line 2561
表示您的脚本超出了已设置的 128M 内存限制。因此,php.ini 的任何有意义的增加都应该在 128M 以上。 256M 应该是你的下一步。记得在执行此操作后重新启动 apache 或 fastcgi 服务。
在将表导出到 sql、csv 或电子表格时,PHPMyAdmin 能够处理无限量的数据。当需要显示带有 ajax 更新和坚韧按钮的漂亮交互式网格时,它无法处理那么多数据。这是因为表的内容被注入(inject)到一个对象中,并且该对象必须将整个内容保存在内存中直到它呈现。
如果 10000 行总计超过 128M,则 PHP 无法将该信息保存在变量中。这不是 PHPMyadmin 的错。
关于php - PhpMyAdmin 能够处理大量数据吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22875283/