简体   繁体   English

PhpMyAdmin 超时与大 SQL 导入错误

[英]PhpMyAdmin timeout with large SQL import error

When I try to paste a large(5000 lines) sql file into PhpMyAdmin, I get this error?当我尝试将大型(5000 行)sql 文件粘贴到 PhpMyAdmin 中时,出现此错误? I know I can use the upload but on my old version of PhpMyAdmin this used to work without a problem.我知道我可以使用上传,但在我的旧版本 PhpMyAdmin 上,这曾经可以正常工作。

ALERT - configured request variable value length limit exceeded - dropped variable 
'sql_query' (attacker '111.171.123.123', file '/usr/share/apache2/phpmyadmin/import.php'),
referer: https://example.co.uk/phpmyadmin/db_sql.php?db=test&server=1&
token=0f355f8bbc6fc09d5c512e0409e9cac9&db_query_force=1

I have already tried changing the $cfg['ExecTimeLimit'] = 0;我已经尝试更改$cfg['ExecTimeLimit'] = 0;

php.ini php.ini

;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

; Maximum execution time of each script, in seconds
max_execution_time = 120     
; Maximum amount of time each script may spend parsing request data
max_input_time = 60 
;max_input_nesting_level = 64 ; Maximum input variable nesting level
;Maximum amount of memory a script may consume (128MB)
memory_limit = 100M 

As far as I'm concerned this message means that Suhosin (a security patch for PHP) is blocking your request because of its length.就我而言,这条消息意味着Suhosin (PHP 的安全补丁)因其长度而阻止了您的请求。 The simplest way to solve your problem without changing Suhosin's config - is to import a file with the same SQL statements to PHPMyAdmin (it allows uploading files for import).在不更改 Suhosin 配置的情况下解决问题的最简单方法 - 是将具有相同 SQL 语句的文件导入 PHPMyAdmin(它允许上传文件以进行导入)。

So basically all you need - is to create a simple text file, paste the same SQL statements into it, and upload this file to PHPMyAdmin - it has the appropriate page for such imports.所以基本上你只需要创建一个简单的文本文件,将相同的 SQL 语句粘贴到其中,然后将此文件上传到 PHPMyAdmin - 它具有用于此类导入的相应页面。

If you really want to use PhpMyAdmin try using the version 3.4.3.2 or higher as I am not sure if yours version has got this如果你真的想使用 PhpMyAdmin 尝试使用 3.4.3.2 或更高版本,因为我不确定你的版本是否有这个

Partial import部分导入
Allow the interruption of an import in case the script detects it is close to the PHP timeout limit.如果脚本检测到它接近 PHP 超时限制,则允许中断导入。 (This might be good way to import large files, however it can break transactions.) (这可能是导入大文件的好方法,但它可能会破坏事务。)

http://www.phpmyadmin.net/home_page/index.php http://www.phpmyadmin.net/home_page/index.php

I hope it helps.我希望它有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM