Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhpMyAdmin timeout with large SQL import error

Tags:

php

phpmyadmin

When I try to paste a large(5000 lines) sql file into PhpMyAdmin, I get this error? I know I can use the upload but on my old version of PhpMyAdmin this used to work without a problem.

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;

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 
like image 946
John Magnolia Avatar asked Aug 12 '11 15:08

John Magnolia


2 Answers

As far as I'm concerned this message means that Suhosin (a security patch for PHP) is blocking your request because of its length. 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).

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.

like image 52
itsmeee Avatar answered Oct 02 '22 16:10

itsmeee


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

Partial import
Allow the interruption of an import in case the script detects it is close to the PHP timeout limit. (This might be good way to import large files, however it can break transactions.)

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

I hope it helps.

like image 27
TigerTiger Avatar answered Oct 02 '22 17:10

TigerTiger