删除大量数据时报错"ERROR 2013 (HY000): Lost connection to MySQL server during query"

查询:
show variables like ‘%quota%’;
tidb_mem_quota_query====>每条SQL占用缓存的大小

show variables like ‘%oom%’;
tidb_mem_oom_action | CANCEL | 或LOG===>直接记录到日志文件中

tidb_mem_oom_action====>如果每条SQK占用缓存的大小超过tidb_mem_quota_query值的时候,
并且启用临时磁盘,临时磁盘没有空间,由此参数控制具体是取消还是继续使用

启用临时磁盘:
show variables like ‘tidb_enable_tmp_storage_on_oom’;
| tidb_enable_tmp_storage_on_oom | ON |

show config where name like ‘%tmp-storage-path%’;
tmp-storage-path

show config where name like ‘%tmp-storage-quota%’;
tmp-storage-quota