TEXT
Variable-length character string. A TEXT column can store up to 65,535 characters, often used for storing longer text content.
Syntax
TEXT[(M)] [CHARACTER SET charset_name] [COLLATE collation_name]Description
Examples
Trailing spaces:
CREATE TABLE strtest (d TEXT(10));
INSERT INTO strtest VALUES('Maria ');
SELECT d='Maria',d='Maria ' FROM strtest;
+-----------+--------------+
| d='Maria' | d='Maria ' |
+-----------+--------------+
| 1 | 1 |
+-----------+--------------+
SELECT d LIKE 'Maria',d LIKE 'Maria ' FROM strtest;
+----------------+-------------------+
| d LIKE 'Maria' | d LIKE 'Maria ' |
+----------------+-------------------+
| 0 | 1 |
+----------------+-------------------+Example of TEXT
Data too Long
Indexing
Difference between VARCHAR and TEXT
For Storage Engine Developers
See Also
Last updated
Was this helpful?

