6

I'm trying to import 641 MB MySQL database with a command:

mysql -u root -p ddamiane_fakty < domenyin_damian_fakty.sql

but I got an error:

ERROR 1064 (42000) at line 2351406: 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 '<br />
<b>Fatal error</b>:  Maximum execution time of 300 seconds exceeded in <b' at line 253

However limits are set much higher:

mysql> show global variables like "interactive_timeout";
+---------------------+-------+
| Variable_name       | Value |
+---------------------+-------+
| interactive_timeout | 28800 |
+---------------------+-------+
1 row in set (0.00 sec)

and

mysql> show global variables like "wait_timeout";
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout  | 28800 |
+---------------+-------+
1 row in set (0.00 sec)

3 Answers 3

16

It seems to me that your .sql file actually contains the text <br /> <b>Fatal error</b>: Maximum execution time of 300 seconds exceeded in <b, which is obviously not valid sql. You have possibly exported your database with some tool like phpMyAdmin, which took longer than 300s to create the export which was cut short at that point in time.

2

This is a syntax error in the .sql file. There should be a line there with "<b>Fatal error: Maximum execution time of 300 seconds exceeded in

This error looks alot like a PHP error to me. During database export/dump, php stopped after 300 seconds, and wrote out the error to its output -> your file.

You should fix php.ini, to allow longer execution time, then export the whole database to a new file, and then import the new file (I guess the database was exported via PHP ofcourse). Or use some other tool to dump the databse (like mysqldump, or mysql-workbench if your prefer a GUI), and import that.

0

I know this is an old question but I want to clarify how you got to get this error.

Usually, this error is produced when you have exported a large MySQL database to an SQL file but the export did not complete successfully resulting in half of an SQL file with the MySQL error appended.

You have then assumed that the export was successful and tried to import it somewhere else and got this error.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .