导入大型 MySQL 数据库时超过 300 秒的最大执行时间错误

Spa*_*ust 6 mysql database import mysql5.5

我正在尝试使用以下命令导入 641 MB MySQL 数据库:

mysql -u root -p ddamiane_fakty < domenyin_damian_fakty.sql
Run Code Online (Sandbox Code Playgroud)

但我有一个错误:

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
Run Code Online (Sandbox Code Playgroud)

但是,限制设置得更高:

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

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

bra*_*n99 15

在我看来,您的 .sql 文件实际上包含 text <br /> <b>Fatal error</b>: Maximum execution time of 300 seconds exceeded in <b,这显然不是有效的 sql。您可能已经使用诸如 phpMyAdmin 之类的工具导出了您的数据库,该工具花费了 300 多秒的时间来创建导出,但在那个时间点被缩短了。