当前位置:网站首页>在Mysql中为什么定义varchar(255)?
在Mysql中为什么定义varchar(255)?
2022-07-21 23:18:00 【sodawoods】
在4.0版本以下,varchar(255)指的是255个字节,使用1个字节存储长度即可。当大于等于256时,要使用2个字节存储长度。所以定义varchar(255)比varchar(256)更好。
但是在5.0版本以上,varchar(255)指的是255个字符,每个字符可能占用多个字节,例如使用UTF8编码时每个汉字占用3字节,使用GBK编码时每个汉字占2字节。
NOTE:在生产环境我们一般用utf8mb4字符集。
边栏推荐
- 2022/07/20--- convert string to integer; Maximum value of sliding window
- [waiting for insurance] what does waiting for insurance rectification mean? What are the rectification contents?
- Deep analysis of JVM object creation and memory allocation of JVM (9)
- RecordRTC的视频录制,回放,截图,下载
- V7 bottom column fragment
- How to do member marketing? 3 tips to retain customers!
- [mysql] index transactions
- service(lb) 和管理的pod
- Chart drawing summary
- Autojs微信研究:多次测试发现偶尔出现调用了click()返回了true,但实际并未点击成功的情况,例如“通讯录”(已解决)
猜你喜欢
PCBA design of body fat scale
leetcode-814:二叉树剪枝
Deep analysis of JVM object creation and memory allocation of JVM (9)
JVM class loading and garbage collection
带你刷(牛客网)C语言百题(第三天)
iTOP-RK3568开发板Debian系统功能测试-有线网测试
webservice接口测试
Application of ERP system in component trading enterprises
软件测试面试中,面试官问你一些比较“刁难”的问题你会怎么回答
稀土开发者大会|StreamNative 翟佳、刘德志分享云原生技术变革之路
随机推荐
(iccv-2021) transfeid: Target Recognition Based on transformer
我的创作纪念日
Interview question 05.07 Pairing exchange
leetcode-6119:元素值大于变化阈值的子数组
"Double business success classic" is newly upgraded and launched! Hot summer new products, waiting for a long time to come!
Common life cycle of uniapp
自动化测试简历编写应该注意哪方面?有哪些技巧?
自动化设备制造行业常见管理难题及解决方案
Pyhton crawls the primary and secondary website pages and saves the crawled image information locally
2022/07/20---把字符串转换成整数; 滑动窗口的最大值
One bite of Stream(9)
《性能之巅第2版》阅读笔记(五)--Disks监测
QT creator shortcut keys, with shortcut key configuration method
win10如何设置锁屏后不熄屏
深入理解完美哈希
简单易用的任务队列-beanstalkd
webservice接口测试
如何正确使用call、bind、apply
稀土开发者大会|Apache Pulsar Committer 刘德志分享云原生技术变革之路
2022.7.21-----leetcode. eight hundred and fourteen