易截截图软件、单文件、免安装、纯绿色、仅160KB

Mysql的varchar类型

自从认识mysql的那天起就知道varchar的长度限制为255,不过现在这种情况已经改变了:
Values in VARCHAR columns are variable-length strings. The length can be specified as a value from 0 to 65,535. The effective maximum length of a VARCHAR is subject to the maximum row size (65,535 bytes, which is shared among all columns) and the character set used.
In contrast to CHAR, VARCHAR values are stored as a one-byte or two-byte length prefix plus data. The length prefix indicates the number of bytes in the value. A column uses one length byte if values require no more than 255 bytes, two length bytes if values may require more than 255 bytes.
...
The following table illustrates the differences between CHAR and VARCHAR by showing the result of storing various string values into CHAR(4) and VARCHAR(4) columns (assuming that the column uses a single-byte character set such as latin1).
Value
CHAR(4)
Storage Required
VARCHAR(4)
Storage Required
''
'    '
4 bytes
''
1 byte
'ab'
'ab  '
4 bytes
'ab'
3 bytes
'abcd'
'abcd'
4 bytes
'abcd'
5 bytes
'abcdefgh'
'abcd'
4 bytes
'abcd'
5 bytes
(http://dev.mysql.com/doc/refman/5.1/en/char.html)
以后基本可以不使用text字段了。。。。。。


相关文档:

使MySQL root账户能远程访问

1.登录MySQL终端 2.授权:
允许所有机器访问MySQL服务器
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH RIVILEGES;
允许指定机器访问MySQL服务器
GRANT ALL PRIVILEGES ON *.* TO 'root'@'IP地址'IDENTIFIED BY 'password' WITH GRANT OPTION; ......

[转]mysql中data_format()

DATE_FORMAT(date,format)
根据format字符串格式化date值。下列修饰符可以被用在format字符串中: %M 月名字(January……December)
%W 星期名字(Sunday……Saturday)
%D 有英语前缀的月份的日期(1st, 2nd, 3rd, 等等。)
%Y 年, 数字, 4 位
%y 年, 数字, 2 位
%a 缩写的星期名字(Sun&h ......

mysql 与Oracle 函数对比

Oracle函数和mysql函数比较
1.       Oracle中的to_number()转换成数字;
Oracle> Select to_number(‘123’) from dual;  -----         123;
           &nbs ......

如何提高Mysql语句插入性能

在表中已有大量的index的情况下插入大量数据,可以采用先将索引删除,然后再插入数据,然后再重新建立索引。之所以这样会快是因为???
7.2.14 Speed of INSERT Statements
The time to insert a record is determined by the following factors, where the numbers indicate approximate proportions:
  & ......

解决MySQL不允许从远程访问的方法

解决MySQL不允许从远程访问的方法
2009-06-04 13:11
1。 改表法。可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"
Sql代码 复制代码
   1. mysql -u root -pvmwaremysql>us ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号