1. When running the SQL file, an error occurred: [ERR] 2013 – Lost connection to MySQL server during query, as shown in Figure 1
[Error] 2013 – Lost connection to MySQL server during query
![When running the SQL file, an error occurred: [ERR] 2013 - Lost connection to MySQL server during query](https://media.shuijingwanwq.com/2017/08/1-3.png)
2. Open the directory C:\ProgramData\MySQL\MySQL Server 5.7 and edit the my.ini file, as shown in Figure 2

3. Change max_allowed_packet=4M to max_allowed_packet=256M, as shown in Figure 3

4. Stop the MySQL server, as shown in Figure 4

5. Start the MySQL server, as shown in Figure 5

6. Run the SQL file again, selecting the encoding: 65001 (UTF-8), as shown in Figure 6

7. Execution succeeded with no errors, as shown in Figure 7

