MySQL: The table is full error - resolved
Apart from my regular duties, I am also the DBA (database administrator) and honorary lately I've been correguir troubleshoot errors and MySQL. Everything started with the problem described below:
Among all our databases, there is one in particular that handles an average of 40k transactions per day. This database runs on MySQL which has a table which already exceeds the 21 million records, which make it have the 4 GB of information.
For its size, this error showed MyISAM table The table is full, which at first we thought we might be limitations 2.4.x kernel ext2 file system (if it is a Red Hat Linux 9).
MySQL's 4GB Limit
The MySQL error, the table is full is a message that is displayed when a table reaches 4GB in size, really underestimated the impact, as they are very few applications that may exceed this amount of data. But when we have consolidated our services and our database server MySQL stops working, is a major problem.
It is advisable to make a good analysis and design of our database so that this does not happen. However, sometimes it's hard to imagine that a table can contain 21 million records in two years.
InnoDB tables do not have this limitation because its storage model is completely different. In a MyISAM table with dynamic or variable-length rows, the index file of the table (nombre_tabla.MYI) rows stored using 32-bit pointer in the data file (nombre_tabla.MYI). This has a limit of 4 GB of space.
Remember that most computers are 32bit since technologies like 64-bit AMD Opteron processors also have support for 32bit.
Solving the problem of the table is full
The solution to the table is full is not very dicil, just enough to run the ALTER TABLE command, but it can take considerable time. Consider the example of the creature table Sleeve Length:
mysql> describe creature;
+-----------------+-----------------------+------+ -----+---------+----------------+
| Field          | Type                 | Null | Key | Default | Extra         |
+-----------------+-----------------------+------+ -----+---------+----------------+
| Guide           | int (10)     unsigned | NoA | PRI | NULL  | auto_increment |
| Ida             | mediumint (8) unsigned | NoA | MUL | 0A      |                |
| Map            | smallint (5) unsigned | NoA | MUL | 0A      |                |
| SpawnMask      | tinyint (3) unsigned  | NoA |     |   1    |                |
| Models        | mediumint (8) unsigned | NoA |     | 0A      |                |
| Equipment_id   | mediumint (9)          | NoA |     | 0A      |                |
| Position_x     | float                | NoA |     | 0A      |                |
| Position_y     | float                | NoA |     | 0A      |                |
| Position_z     | float                | NoA |     | 0A      |                |
| Orientation    | float                | NoA |     | 0A      |                |
| Spawntimesecs  | int (10)     unsigned | NoA |     | 120A    |                |
| Spawndist      | float                | NoA |     |  5     |                |
| Currentwaypoint | mediumint (8) unsigned | NoA | Â Â Â Â | 0A Â Â Â Â Â | Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â |
| Curhealth      | int (10)     unsigned | NoA |     |   1    |                |
| Curmana        | int (10)     unsigned | NoA |     | 0A      |                |
| DeathState     | tinyint (3) unsigned  | NoA |     | 0A      |                |
| MovementType   | tinyint (3) unsigned  | NoA |     | 0A      |                |
+-----------------+-----------------------+------+ -----+---------+----------------+
17 rows in set (0.02 sec)
To find the limit of the size of the table, use the SHOW TABLE STATUS. And note that Max_data_length is 4 GB.
mysql> SHOW TABLE STATUS LIKE 'creature' \ G;
*************************** 1. row ***************************
          Name: creature
        Engine: MyISAM
       Version: 10
    Row_format: Dynamic
          Rows: 95,094
 Avg_row_length: 46
   Data_length: 4382696
Max_data_length: 281474976710655
  Index_length: 2628608
     Data_free: 0
 Auto_increment: 106,039
   Create_time: 2008-09-19 09:54:05
   Update_time: 2008-09-19 10:31:08
    Check_time: 2008-09-19 10:31:09
     Collation: utf8_general_ci
      Checksum: NULL
 Create_options: row_format = DYNAMIC
       Comment: Summon System
1 row in set (0.00 sec)
ERROR:
No query specified
mysql>
Let's fix this by typing: mysql> ALTER TABLE creature AVG_ROW_LENGTH max_rows = 200000000000 = 50;
Query OK, 0 rows affected (0.03 seconds)





























