开发者

Max of 4kB for MySQL text column?

Ho开发者_开发问答w can I have a max length of 4096 bytes for a MySQL text or blob column? Is this even possible?


No, check this page:

http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html

You can use maybe VARCHAR or VARBINARY instead of the TEXT or BLOB field. For VARHCHAR and VARBINARY you can specify a length of 4096 if you want. Example: MYSTRING VARCHAR(4096);. But pay attention that, as the manual says:

The effective maximum length of a VARCHAR in MySQL 5.0.3 and later is subject to the maximum row size (65,535 bytes, which is shared among all columns) and the character set used.

So if you use a lot of large columns, you must be sure to stay under the 64k limit for a row

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜