# /etc/my.cnf # Raise max size to 4GB SET GLOBAL tmp_table_size = 1024 * 1024 * 1024 * 4; SET GLOBAL max_heap_table_size = 1024 * 1024 * 1024 * 4; # If you are checking the above variables with SELECT @@max_heap_table_size; # Or SHOW VARIABLES LIKE 'max_heap_table_size" # If already a memory table, the alter will not change anything. # Only apply the new max size. ALTER TABLE table_name ENGINE=MEMORY;