What are the precautions for exporting large tables through mysqldump?
When exporting data through mysqldump, if the -q parameter is enabled, the results of the SELECT statement are not placed in the buffer but directly dumped to the standard output. The result is at most the result of the current row of the buffer. Under normal circumstances, it will not exceed the max_allowed_package limit. By default, this parameter is enabled. If this parameter is disabled, the results of the SELECT statement are placed in the local buffer and then sent to the client, which consumes more memory.
For small datasets, disabling the -q parameter can increase the export speed. For large datasets, if they cannot be completely stored in the memory buffer, swaps may be generated. Besides consuming the memory of the host, it may even cause the database host to break down due to being out of memory. Therefore, it is recommended that you enable the -q parameter when using mysqldump to back up large datasets.