How to Avoid table full errors in Mysql? _ MySQL-mysql tutorial

Source: Internet
Author: User
There are several ways for Mysql to avoid table full errors:

? You are using a MySQL server lower than Version 3.23, and the "in memory" temporary table exceeds the tmp_table_size byte. To avoid this problem, you can use the "-O tmp_table_size = val" option to increase the size of the temporary table in mysqld, or use the SQL option SQL _BIG_TABLES before issuing a problematic query.

You can also use the "-- big-tables" option to start mysqld. It is identical to SQL _BIG_TABLES for all queries.

This problem should not occur since MySQL 3.23. If the temporary table in memory exceeds tmp_table_size, the server automatically converts it to a disk-based MyISAM table.

? You are using an InnoDB table, which exceeds the InnoDB tablespace. In this case, the solution is to increase the InnoDB tablespace.

? You are using an ISAM or MyISAM table on an operating system that only supports 2 GB files. the data file or index file has reached this limit.

? You are using the MyISAM table, and the space required by the table exceeds the size allowed by the internal pointer. If MAX_ROWS table is not specified during table creation, MySQL uses the myisam_data_pointer_size system variable. The default value is 6 bytes, which can hold up to TB of data.

Use this statement to check the maximum data/index size:

Show table status from database LIKE 'tbl _ name ';
You can also use myisamchk-dv/path/to/table-index-file.

If the pointer size is too small, use alter table to correct the problem:

Alter table tbl_name MAX_ROWS = 1000000000 AVG_ROW_LENGTH = nnn;

AVG_ROW_LENGTH must be specified only for tables with BLOB or TEXT columns. In this case, MySQL cannot only optimize the required space based on the number of rows.

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.