Mysql The table 'xxxx' is full to set The temporary table size

Source: Internet
Author: User

In the temporary mysql table, xxx is full. You only need to modify the tmp_table_size and max_heap_table_size parameters in my. ini.

Tmp_table_size if the temporary table in the memory exceeds this value, MySQL automatically converts it to the MyISAM table on the hard disk. If you execute many advanced group by queries with a large amount of memory, you can increase the value of tmp_table_size. Max_heap_table_size this variable sets the maximum size of MEMORY (HEAP) tables that can be increased

Tmp_table_size

If the temporary table in the memory exceeds this value, MySQL automatically converts it to the MyISAM table on the hard disk. If you execute many advanced group by queries with a large amount of memory, you can increase the value of tmp_table_size.

Max_heap_table_size
This variable sets the maximum size of the MEMORY (HEAP) Table space that can be increased. This variable is used to calculate the MAX_ROWS value of the MEMORY table. Setting this variable on an existing memory table does not work unless you use the create table or truncate table statement to recreate the TABLE.


Method 1: modify my. ini or my. cnf

The Code is as follows: Copy code

Tmp_table_size = 64 M
Max_heap_table_size = 32 M

The biggest drawback of this method is that, once restarted, everything is restored to the default value.

Method 2: mysqld command line

The Code is as follows: Copy code
Mysqld_safe-key_buffer_size = 512 K-sort_buffer_size = 16 K
-Tmp_table_size = 64 M-max_heap_table_size = 32 M &

Method 3: Dynamic Modification

Because tmp_table_size and max_heap_table_size both have session scopes, do as much as possible.

The Code is as follows: Copy code

Set session tmp_table_size = 64*1024*1024
Set session max_heap_table_size = 32*1024*1024

If you have the Server Management permission, we recommend that you use the first method. The last two methods only need to restart the mysql server and restore everything to the previous configuration. Therefore, it is best to modify my. ini.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.