MySQL中varchar的最大范围是多少? [英] What is the maximum range of varchar in MySQL?
问题描述
MySQL中varchar的最大范围是多少?
What is the maximum range of varchar in MySQL?
我正在使用最新版本的MySQL,并且在许多站点中都听说它的大小为255.但是当我尝试提供更大的大小(例如500或1000)时,它对我有用.那么varchar数据类型有最大数量吗?
I am using the latest version of MySQL and in many sites it is being told that the size is 255. But when i am trying to give a higher size like 500 or 1000, it works for me. So is there a maximum number for varchar datatype?
推荐答案
It was 255 before 5.0.3, but now:
VARCHAR列中的值是可变长度的字符串.长度可以指定为从0到 65,535 的值.
5.0.x的文档显示了过渡:
VARCHAR列中的值是可变长度的字符串.在MySQL 5.0.3之前,长度可以指定为0到255之间的值,在5.0.3和更高版本中,长度可以指定为0到65,535之间的值.
Values in VARCHAR columns are variable-length strings. The length can be specified as a value from 0 to 255 before MySQL 5.0.3, and 0 to 65,535 in 5.0.3 and later versions.
这篇关于MySQL中varchar的最大范围是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!