# 文本数据类型


__*TEXT 数据类型*__

__*TINYTEXT 数据类型*__

__*MEDIUMTEXT 数据类型*__

__*LONGTEXT 数据类型*__

+ `TINYTEXT`: 最大列长度为 255
+ `TEXT`: 最大列长度为 65535
+ `MEDIUMTEXT` and `LONGTEXT`: 
  + 以上两个数据类型的最大列长度受下列系统参数影响:
    + TiDB server **txn-entry-size-limit**
    + TiKV server **raft-entry-max-size**

--------------------------------------------------------------------

The largest single Key-Value pair supported in TiDB is 6 MB by default.

If a pair exceeds this limit, you need to properly adjust the txn-entry-size-limit configuration value to relax the limit.

`txn-entry-size-limit`: The size limit of a single row of data in TiDB. Default value: 6291456 (in bytes). he maximum value of this configuration item does not exceed 125829120 (120 MB).

`raft-entry-max-size`: The hard limit on the maximum size of a single log. Default value: "8MB".

- TEXT type
  - Text string. M is the maximum column length (maximum number of characters), in the range 0 to 65535. When selecting a TEXT length, it should be determined from the size of the longest line and the character set used.
`TEXT[(M)] [CHARACTER SET charset_name] [COLLATE collation_name]` 

- TINYTEXT type
  - Similar to TEXT, except that the maximum column length is 255.
`TINYTEXT [CHARACTER SET charset_name] [COLLATE collation_name]` 

- MEDIUMTEXT type
  - Similar to TEXT, except that the maximum column length is 6291414.
`MEDIUMTEXT [CHARACTER SET charset_name] [COLLATE collation_name]` 

- LONGTEXT type
  - Similar to TEXT, except that the maximum column length is 6291414.
`LONGTEXT [CHARACTER SET charset_name] [COLLATE collation_name]` 