How to prevent script timeout in phpMyAdmin

« Back :: Tagged with Databases :: HowTo's :: Migrating :: phpMyAdmin :: Snippets :: XAMPP ::

This is how to prevent phpMyAdmin from timing out when importing an sql file.

I use XAMPP, and each time I was trying to import a large sql file, or a gzip file for that matter, phpMyAdmin threw a timeout error in my face.

After some investigation I came to this simple solution; In the file config.inc.php which is in your phpMyAdmin's install dir, you put the snippet below:

/**
 * Set script timout in seconds
 * 0 = unlimited
 */
$cfg['ExecTimeLimit'] = 0; /* no script timeout */

Before:

Fatal error: Maximum execution time of 300 seconds exceeded in
C:\xampp\phpMyAdmin\libraries\import\sql.php on line 129

After:

Import has been successfully finished, 33211 queries executed.

:)

Comments

Anonymous @ November 17th, 2010 - 02:00

works as advertised

Import has been successfully finished, 5749 queries executed!

Anonymous (not verified) @ April 7th, 2013 - 10:14

Can you plz tell me how much time it is taking for execute?

deuxcode @ April 10th, 2013 - 06:30

It depends on how big your import file is and on your computer performance. It can take quite a while actually.

Anonymous @ March 6th, 2011 - 19:51

Thx for the tip! I'm trying to import a 465mb sql file and I keep getting a timeout message even if the file is gzipped in to a 26 mb archive.

Anonymous (not verified) @ June 8th, 2012 - 12:51

I can now see the progress even thought its not done.Thanx

Jose Philip Raja (not verified) @ July 2nd, 2012 - 12:02

Import has been successfully finished, 31102 queries executed. ()

Chris Vickers (not verified) @ July 10th, 2012 - 11:11

Works Perfectly. Really useful tip

Anon001 (not verified) @ April 22nd, 2013 - 11:13

Thanks! Saved my day!

Anonymous (not verified) @ May 23rd, 2013 - 01:11

Thank you very much.
Very usefull tip.
;)

Anonymous (not verified) @ August 22nd, 2013 - 11:15

Worked perfectly, thank you very much!

Rem (not verified) @ December 15th, 2013 - 06:48

Thanks for the snippet. I added it to my config.inc file right before the closing ?> tag and it worked great.

Nick Goodey (not verified) @ April 4th, 2014 - 01:02

Worked great importing a 26MB Moodle backup

Thanks from Lincoln University

Ash (not verified) @ April 18th, 2014 - 15:28

Alhamdulillah!
Hey you saved my day and work! thank you very much!

Deon (not verified) @ June 22nd, 2014 - 12:42

Import has been successfully finished, 135965 queries executed.

kenny (not verified) @ October 8th, 2014 - 10:13

Waow! Can't thank you enough. Thanks for the excellent tip. I believe you already know my experience before I came across your tip. Thanks again.

Deb (not verified) @ October 8th, 2014 - 13:52

Thank you! Thank you so much for this! It has driven me crazy on XAMPP for ages. And now it finally works.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <blockquote> <blockcode> <pre> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Copyright © 2010 deuxcode.com
Powered by Drupal. Valid XHTML 1.0 Strict and CSS 2.1.