No,they are so different.The varchar and char types are similar.They are diferent in maximun length.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.
The LONG and LONG VARCHAR map to the MEDIUMTEXT data type.
If you want to know more about it,you can read the mysql 5.0 reference manual,the Data Types theme.
The LONG and LONG VARCHAR map to the MEDIUMTEXT data type.
If you want to know more about it,you can read the mysql 5.0 reference manual,the Data Types theme.
1.varchar 最多只能存储255个字符,text能够存储65535(好像是,记不清了)个
2.从存储上来看varchar(255),如果你存储的是"test",那分配的存储空间是4,所以255只是一个最大存储字符数,实际存储的空间还需要由实际的字节数来控制(只要不超过最大存储字符数)
Char varchar区别:
Char固定大小,如果录入字符串长度不够,则用空格补全。
而varchar类型把它(定义时规定上限)视为最大值并且只使用了存储字符串实际上需要的字节数(增加一个额外的字节记录长度)。因而较短值被插入道varchar中不会用空格填补,但在较长时仍被截断。
对于TEXT和BLOB类型来说区别也是一样的,TEXT不区分大小写,而BLOB区分。
TEXT相对于varchar能接收的字符串更长,也就是说多于varchar的255个字符