mysql二进制类型
2016-05-05 10:02
501 查看
由于之前网站使用第三方登录,QQ昵称比较特殊,所以用二进制的字段类型存储。
mysql二进制类型有:
BINARY
VARBINARY
TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB
顺便列一下各种数据类型的存储范围:
mysql二进制类型有:
BINARY
VARBINARY
TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB
顺便列一下各种数据类型的存储范围:
Storage Requirements for Numeric Types
Data Type | Storage Required |
---|---|
TINYINT | 1 byte |
SMALLINT | 2 bytes |
MEDIUMINT | 3 bytes |
INT, INTEGER | 4 bytes |
BIGINT | 8 bytes |
FLOAT( ) | 4 bytes if 0 <= p<= 24, 8 bytes if 25 <= p<= 53 |
FLOAT | 4 bytes |
DOUBLE [PRECISION], REAL | 8 bytes |
DECIMAL( ,D), NUMERIC( ,D) | Varies; see following discussion |
BIT( ) | approximately (M+7)/8 bytes |
Storage Requirements for Date and Time Types
Data Type | Storage Required Before MySQL 5.6.4 | Storage Required as of MySQL 5.6.4 |
---|---|---|
YEAR | 1 byte | 1 byte |
DATE | 3 bytes | 3 bytes |
TIME | 3 bytes | 3 bytes + fractional seconds storage |
DATETIME | 8 bytes | 5 bytes + fractional seconds storage |
TIMESTAMP | 4 bytes | 4 bytes + fractional seconds storage |
Storage Requirements for String Types
Data Type | Storage Required |
---|---|
CHAR( ) | M× wbytes, 0 <= <= 255, where wis the number of bytes required for the maximum-length character in the character set. SeeSection 15.2.6.7, “Physical Row Structure” for information about CHARdata type storage requirements for InnoDBtables. |
BINARY( ) | Mbytes, 0 <= <= 255 |
VARCHAR( ), VARBINARY( ) | L+ 1 bytes if column values require 0 − 255 bytes, L+ 2 bytes if values may require more than 255 bytes |
TINYBLOB, TINYTEXT | L+ 1 bytes, where L< 28 |
BLOB, TEXT | L+ 2 bytes, where L< 216 |
MEDIUMBLOB, MEDIUMTEXT | L+ 3 bytes, where L< 224 |
LONGBLOB, LONGTEXT | L+ 4 bytes, where L< 232 |
ENUM(' ','value2',...) | 1 or 2 bytes, depending on the number of enumeration values (65,535 values maximum) |
SET(' ','value2',...) | 1, 2, 3, 4, or 8 bytes, depending on the number of set members (64 members maximum) |
参考:http://dev.mysql.com/doc/refman/5.7/en/data-types.html
相关文章推荐
- mysql索引总结----mysql 索引类型以及创建
- mysql之视图详解
- mysql触发器的作用及语法
- mysql触发器(Trigger)简明总结和使用实例
- 我的MYSQL学习心得(十二) 触发器
- MySQL触发器使用详解
- mysql导出数据到文件
- mysql之触发器trigger
- MySQL存储过程详解 mysql 存储过程
- MySql trigger 触发器
- C#双串口采集光照度与温度和湿度 数据保存在mysql 参数自动保存 解析格式十六进制收发
- MySQL密码忘记,怎么办?
- MySQL文档存储的发展
- Mysql 语句执行顺序
- mysql-5.7.12-winx64 MySQL服务无法启动,服务没有报告任何错误的解决办法
- Mysql 数据中文乱码问题解决
- membership 启用 roleManager 抛出异常:未能加载文件或程序集MySql.Web
- 赶集mysql军规
- MySQL的分支
- MYSQL使用正则表达式过滤数据