I would like to know what the max size is for a MySQL VARCHAR type.
I read that the max size is limited by the row size which is about 65k. I tried setting the field to varchar(20000)
but it says that that's too large.
I could set it to varchar(10000)
. What is the exact max I can set it to?
Best Answer
Keep in mind that MySQL has a maximum row size limit
Maximum size a single column can occupy, is different before and after MySQL 5.0.3
However, note that the limit is lower if you use a multi-byte character set like utf8 or utf8mb4.
Use
TEXT
types inorder to overcome row size limit.More details on BLOB and TEXT Types
Even more
Checkout more details on Data Type Storage Requirements which deals with storage requirements for all data types.