跳到主要內容

MySQL TEXT 格式 的 長度限制

因為一些因素必須查詢TEXT的長度限制,TEXT主要有以下幾種

TINYTEXT
TEXT
MEDIUMTEXT
LONGTEXT




平常都很直覺的使用TEXT,很少會去探討該使用哪個,但沒想到會因為欄位資料需求大於TEXT可存範圍,這真的有點誇張Orz…,以下是TEXT格式長度的限制

TINYTEXT 256 bytes
TEXT 65,535 bytes = ~64KB
MEDIUMTEXT 16,777,215 bytes = ~16MB
LONGTEXT 4,294,967,295 bytes = ~4GB


這樣看起來,TEXT也沒有很大呀~XD

留言

這個網誌中的熱門文章

What is phpize

What is phpize According to the PHP official document : The phpize command is used to prepare the build environment for a PHP extension. If you need to build such an extension that from github or another code repositories, you can use  build tools to perform the build manually.