VARCHAR(255)之后的第二件事是什么 [英] What is the next best thing after VARCHAR(255)

查看:71
本文介绍了VARCHAR(255)之后的第二件事是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一张桌子,上面有大约200万条记录. 我有一个称为message的字段,将其设置为varchar(160),我需要比varchar(255)大的东西,因为我需要能够在其中存储约500个字符,在不增加大小的情况下使用的下一个最佳数据类型是什么数据库的数量?

I have a table with about 2 million records in it. I have a field called message which is setup as varchar(160) and I need something bigger that varchar(255) because I need to be able to store about 500 characters in it, what is the next best datatype to use without increasing the size of the db drastically?

谢谢

推荐答案

从MySQL 5.0.3 开始,您可以简单地使用VARCHAR(500).

Starting with MySQL 5.0.3, you can simply use VARCHAR(500).

M表示最大列长度,以字符为单位.在MySQL 5.0中,M的范围在MySQL 5.0.3之前为0到255,在MySQL 5.0.3及更高版本中为0到65,535.

M represents the maximum column length in characters. In MySQL 5.0, the range of M is 0 to 255 before MySQL 5.0.3, and 0 to 65,535 in MySQL 5.0.3 and later.

这篇关于VARCHAR(255)之后的第二件事是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆