4

I am trying to import a large database into my WAMP 2.5 server phpmyadmin. After importing some tables an error occurs:

Fatal error: Maximum execution time of 360 seconds exceeded in C:\wamp\apps\phpmyadmin4.1.14\libraries\dbi\DBIMysqli.class.php on line 285

and the importing process is stopped. I have already increased max_execution_time in my php.ini file. Can anyone help me resolve this problem?

War10ck
  • 12,387
  • 7
  • 41
  • 54
rahuldas
  • 120
  • 1
  • 1
  • 6
  • so either raise the limit, disable it entirely, or split your job into smaller bits that fit within your limit. those are your only practical choices. And honestly, what exactly are you expecting us to be able to help with? "Have you tried 361 seconds? How about 362?" – Marc B Jul 24 '14 at 14:25
  • If you start the import abput phpmyadmin you can disable the max runtime for only the import – KhorneHoly Jul 24 '14 at 14:28

3 Answers3

22

Don't modify the php.ini file !

Modify the alias of the phpMyAdmin file : J:\wamp\alias\phpmyadmin.conf

Before the line </Directory>, you can describe what you want :

php_admin_value upload_max_filesize 128M
  php_admin_value post_max_size 128M
  php_admin_value max_execution_time 360
  php_admin_value max_input_time 360
</Directory>

You can change the values of time or size as you want.

Evans Belloeil
  • 2,413
  • 7
  • 43
  • 76
  • If you changed the value in php.ini with no luck (error still saying 360) check this file, line 26 (might be in your C:\ drive) – BillyNair Apr 25 '15 at 08:21
  • this is the right solution in my opinion, but i ended up splitting my import files into a 100,000 entries each anyway... just to make them more manageable. – Symbolic Jan 05 '16 at 21:17
6

You can also forget about phpMyAdmin completely and use the mysql console

Using the wampmanager icon menus do the following :-

left click wampmanager -> MySQL -> MySQL Console

If you have changed the password for the root userid enter that when challenged or if you have not changed it just hit enter.

Make sure there is a USE databasename in the backup file, if not enter it manually now and then use the source command to run the restore from your backup file.

i.e.

USE YourDatabase;
SOURCE C:/path/to/backup/file.sql;

Note the use of UNIX directory seperators even though you are on windows.

This tool has no time limitations as its not a PHP script, and will run to the end of your backup with no issues.

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
  • 2
    much better than the one that is marked as answered – Murtaza Mandvi Feb 16 '15 at 07:17
  • 4
    @MurtazaMandvi Thanks, but for a beginner the accepted answer is probably easier, especially as WAMPServer 2.5 comes with those exact settings pre-configured and just increasing them is very simple. Most beginners get a little frightened by the command line. – RiggsFolly Feb 16 '15 at 10:22
  • Very helpful, had no idea about this very useful facility. Always missed mysql < source.sql type functionality on my local wamp setup. thanks. – Tofuwarrior Oct 02 '15 at 13:07
0

Although strongly not recommended, you can remove the maximum script run-time restriction by setting max_execution_time to zero:

http://php.net/manual/en/info.configuration.php#ini.max-execution-time

If there's a more reliable way for you to get the file onto the server (SFTP?) I would suggest you try that first.

oliakaoil
  • 1,615
  • 2
  • 15
  • 36