Skip to content

LONGTEXT

CREATE TABLE Sample(
ID INT,
Notes LONGTEXT
);
INSERT INTO Sample(ID, Notes)
VALUES(1, 'This is an example of LONGTEXT in MySQL');
Query OK, 0 rows affected (0.22 sec)
Query OK, 1 row affected (0.01 sec)

This example creates a new table ‘Sample’ with a column ‘Notes’ that has a data type of LONGTEXT. One row is then inserted into ‘Sample’, including a LONGTEXT value. The LONGTEXT data type in MySQL can contain a maximum of 4,294,967,295 characters, making it ideal for storing large amounts of text.