8

Using SQL Server you just have to give the "MAX" parameter to the length of a text data type, but in MySQL there's no such a thing.

According to Ispirer:

"n" is the maximum number of characters, optional

Range: 1 ⇐ n ⇐ 21845 (65535 bytes is the maximum row size shared among all columns)

Does it mean that:

[SQL Server] "NVARCHAR(MAX)" == [MySQL]"NVARCHAR(N)"

Or do i have to say NVARCHAR(21845) as NVARCHAR(MAX) in MySQL?

Jonathan Solorzano
  • 241
  • 1
  • 3
  • 7

2 Answers2

11

According to this MySQL document the LONGTEXT datatype in MySQL is 4 Gigabytes.

http://wiki.ispirer.com/sqlways/mysql/data-types/longtext

Note that the number of characters depends on the encoding.

RLF
  • 14,035
  • 2
  • 34
  • 47
3

TEXT (max of 64K bytes) or MEDIUMTEXT (max 16M bytes) is typically used. There is no 'max' after them.

VARCHAR(1111) is like NVARCHAR; the 1111 is the limit on characters (not bytes). VARCHAR is limited to 64K characters.

Rick James
  • 80,479
  • 5
  • 52
  • 119