3

I'm attempting to migrate a database with a SQL file I was provided. However, running the source command returns me:

Fatal error: Maximum execution time of 300 seconds exceeded

This is straight from the MySQL console where I've executed the source command. It seems to be failing because the table has over 16 million lines of data. My question is, where is the mysql setting to increase max execution time? Everyone keeps suggesting php.ini settings, but this isn't through a browser...Any help would be greatly appreciated.

3 Answers3

4

I have run into this issue quite a few times and always got the "its a php error" answer. the way i got around it is by logging into the sql db and then running the command

SOURCE /path/to/file 

opposed to something like:

root@fishBowl# mysql -u root -p db < db.sql

I would suggest using the absolute path name when you do the SOURCE command. that should do the trick!

Fluffeh
  • 33,228
  • 16
  • 67
  • 80
JBones
  • 41
  • 2
  • 1
    edit: you have to select db before source. and i figured this out when i migrated a 7.2 gb database – JBones Sep 28 '12 at 02:11
1

It's a PHP error, not mysql one. MySQL does not have a easy timer for query timeouts.

Fatal error: Maximum execution time of 300 seconds exceeded

Community
  • 1
  • 1
dAm2K
  • 9,923
  • 5
  • 44
  • 47
0

The accepted answer is right insofar as this is a PHP error, but it's worth noting that it has nothing to do with the import process, and is probably an error that exists as text in the SQL file you're attempting to import.

I ran into this error when importing a database, and eventually discovered that PHPMyAdmin had timed out while exporting. This caused the last line of the export to be an HTML-formatted error from PHP, which only caused an error once MySQL got to that line.

Will
  • 13
  • 2