Mysql max row size

I don’t know why I have such strange behavior on mysql 5.6.24, can you help me? you think this is a mistake

mysql -D database --default_character_set utf8 -e "ALTER TABLE abc_folder ADD COLUMN lev10 varchar(5000);"

ERROR 1118 (42000) on line 1: line size too large. The maximum row size for the type of table used, not counting the BLOB, is 65535. This includes storage overhead, check the manual. You must change some columns to TEXT or BLOB

instead

 mysql -D database --default_character_set utf8 -e "ALTER TABLE abc_folder ADD COLUMN lev10 varchar(50000);"

In other words, a large varchar () record is accepted and works correctly. Does anyone know what is going on?

+4
source share
1 answer

, abc_folder 65535 TEXT BLOBS. 65535 - , 16- . :

, InnoDB 65535 , MySQL 65 535 :

mysql> CREATE TABLE t (a VARCHAR(8000), b VARCHAR(10000),
    -> c VARCHAR(10000), d VARCHAR(10000), e VARCHAR(10000),
    -> f VARCHAR(10000), g VARCHAR(10000)) ENGINE=InnoDB;
ERROR 1118 (42000): Row size too large. The maximum row size for the
used table type, not counting BLOBs, is 65535. You have to change some
columns to TEXT or BLOBs

, MySQL MySQL, , 16- .

, VARCHAR (5000) TEXT . TEXT, 5000 , . substr .

INSERT INTO abc_folder (lev10) VALUES (SUBSTR('Some Text',0, 5000))
+1

All Articles