mysql 字符串不限长度,mysql中的字符串长度是否有限制?
I am using MySQL data base with Rails. I have created a field of type string. Are there any limits to its length? What about type text?
Also as text is variable sized, I believe there would be extra costs associated with using text objects. How important can they get, if at all?
解決方案
String, in general, should be used for short text. For example, it is a VARCHAR(255) under MySQL.
Text uses the larger text from the database, like, in MySQL, the type TEXT.
For information on how this works and the internals in MySQL and limits and such, see the other answer by Pekka.
If you are requesting, say, a paragraph, I would use text. If you are requesting a username or email, use string.
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的mysql 字符串不限长度,mysql中的字符串长度是否有限制?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mysql page校验_MySQL I
- 下一篇: Mysql表结构升级_mysql表结构升