0
CREATE TABLE `test` (
  `a` varchar(65535)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

cannot create and get an error:

Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs

CREATE TABLE `test1` (
  `a` varchar(65536)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

if change 65535 to 65536, it works, and the type of a auto-transfer from varchar to mediumtext.

Alessio Cantarella
  • 5,077
  • 3
  • 27
  • 34
  • Does this answer your question? [What is the MySQL VARCHAR max size?](https://stackoverflow.com/questions/13506832/what-is-the-mysql-varchar-max-size) –  Mar 14 '20 at 12:33

1 Answers1

0

500ms of search:

> TINYTEXT      256 bytes    
> TEXT          65,535 bytes        ~64kb 
> MEDIUMTEXT    16,777,215 bytes    ~16MB
> LONGTEXT      4,294,967,295 bytes ~4GB
  • this can explain why varchar(65,536) change to MEDIUMTEXT, but can not explain why varchar(65535) get an error – user13061517 Mar 15 '20 at 10:57
  • @user13061517 the reason why 65.536 gives an error is because of temporary disk space. I do assume you are using phpMyAdmin. Check this answer out to give you a little more insight. https://stackoverflow.com/questions/565997/in-mysql-what-does-overhead-mean-what-is-bad-about-it-and-how-to-fix-it –  Mar 15 '20 at 11:30