Why does MySQL shut down when importing data with the source command?

This crash most often occurs when you use the source command to import large amounts of data, since it can only execute a limited amount of queries.

Instead, we recommend you use the MySQL import command to import large amounts of data. For more detailed steps, see How to Import MySQL Databases into DigitalOcean Managed Databases .

Update backup user permissions, remove the –single-transaction flag, or downgrade mysqldump.
Remove or replace the DEFINER in the dump file.
Adjust the sort_buffer_size value while assessing its impact on memory consumption and query performance.