During testing of a web form I’m developing that has some lengthy input fields, I hit the upper size limit for the VARCHAR field type. Looking for a suitable alternative I found.
|TINYBLOB, TINYTEXT||(255 Bytes)|
|BLOB, TEXT||(64 Kilobytes)|
|MEDIUMBLOB, MEDIUMTEXT||(16 Megabytes)|
|LONGBLOB, LONGTEXT||(4 Gigabytes)|
I went for TEXT which seemed more than big enough. However when you have multiple large fields being submitted together MySQL may still error. To overcome this. Edit /etc/my.cnf under the [MySQL] section add :
innodb_file_per_table innodb_file_format = Barracuda
Restart MySQL for the change to take effect /etc/init.d/mysql restart
Then update your table to use the compressed row format, setting the block size to 8.
ALTER TABLE appraisal ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;