700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > mysql 字符串不限长度 mysql中的字符串长度是否有限制?

mysql 字符串不限长度 mysql中的字符串长度是否有限制?

时间:2024-03-27 02:43:21

相关推荐

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.

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。