知乎专栏 |
出现这个错误一般是 tmp_table_size 设置小于 max_heap_table_size 造成的。
show variables like '%table_size%';
解决方法,将 tmp_table_size 设置等于 max_heap_table_size
mysql> show variables like '%table_size%'; +---------------------+----------+ | Variable_name | Value | +---------------------+----------+ | max_heap_table_size | 16777216 | | tmp_table_size | 16777216 | +---------------------+----------+ 2 rows in set (0.00 sec)