I received this error a few times, and variations of it, when trying to import some sql at the command prompt (CLI).
ERROR 1064 (42000) at line 3499917: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘Fatal error: Maximum execution time of 300 seconds exceeded in /usr/share/phpmyadmin/libraries/export/sql.php on line 757‘
Lots of googling kept pointing to changing the maximum execution time of Apache or PHP, by default Apache is 300 seconds (as per my error) and PHP 30 seconds. It didn’t make sense as I was doing am import at the CLI, which doesn’t use Apache or PHP. The mistake I made was using phpmyadmin to export the sql file I was trying to import. Despite the sql file downloading correctly from phpmyadmin and not reporting any errors, the last lines in my sql file was
[End of file snippet ...]
(3566987, 1225461, 4, 52530, ‘2009-05-00′),
(3566988, 1225464, 4, 52530, ‘2009-05-00′),
(3566989, 1577089, 4, 4422, ‘2009-05-00′),
(3566990, 1762231, 8, 4422, ‘2009-05-00′),
(3566991, 1768654, 8, 4422, ‘2009-05-00′)<br />
<b>Fatal error</b>: Maximum execution time of 300 seconds exceeded in <b>/usr/share/phpmyadmin/libraries/export/sql.php</b> on line <b>757</b><br />
The solution is of course to do things properly and use mysqldump -u [USERNAME] -p [DATABASE NAME] [TABLE] > [OUTPUT FILE NAME].sql.
Leave the first comment ▶












