【MySQL数据类型1之 数值类型】
MySQL基本数值类型大致可以分成:
整数类型:TINYINT、SAMLLINT、MEDIUMINT、INT、BIGINT--1字节、2、3.、4、8
浮点数类型:FLOAT(m,d)、DOUBLE(m,d)==REAL-4字节、8
定点数类型:DECIMAL(m,d)、NUMERIC-m+2字节、8
位类型:BIT(m)-1-8字节
各个类型的详细范围可以参考mysql文档
数据类型小例:
1.整数类型
create table t1
(
id int,
id2 int(4)
);
insert t1 select 1,2;
select * from t1;
+------+------+
| id | id2 |
+------+------+
| 1 | 2 |
+------+------+
alter table t1 modify id int zerofill;
alter table t1 modify id2(4) int zerofill;
select * from t1;
+------------+------------+
| id | id2 |
+------------+------------+
| 0000000001 | 0002 |
+------------+------------+
insert t1 select 1,11111;
Select * from t1;
+------------+------------+
| id | id2 |
+------------+------------+
| 0000000001 | 0002 |
| 0000000001 | 11111 |
+------------+------------+
insert t1 select -1,-2;
+-------+------+---------------------------------------------+
| Level | Code | Message |
+-------+------+---------------------------------------------+
| Error | 1264 | Out of range value 
相关文档:
如若转载本文,请注明原始出处:http://hi.baidu.com/hexiong/blog/item/e860e5dd9b0d3ae376c6381a.html
(hexiong@baidu or iihero@CSDN)
偶尔碰到有人问使用mysql命令行,老让人输入--default-character-set=gbk之类无聊的选项,让人烦。让人多输入了几个字符,确实有点不对劲。
加上有时候自己有时候DIY,很少在window ......
2009-05-05
打开MySQL远程访问权限
关键字: mysql
1、改表法
可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"
mysql -u root -p
mysql>use mysql;
mysql>upda ......
1、用MySQLDriverCS连接MySQL数据库
先下载和安装MySQLDriverCS,地址:http://sourceforge.net/projects/mysqldrivercs/在安装文件夹下面找到MySQLDriver.dll,然后将MySQLDriver.dll添加引用到项目中注:我下载的是版本是 MySQLDriverCS-n-EasyQueryTools-4.0.1-DotNet2.0.exe using System;using System.Collectio ......
就象许多的PHP开发者一样,在刚开始建立动态网站的时候,我都是使用相对简单
的数据结构。PHP在连接数据库方面的确实是十分方便(译者注:有些人认为PHP在连接不同数据库时没有一个统一的接口,不太方便,其实这可以通过一些扩
展库来做到这一点),你无需看大量的设计文档就可以建立和使用数据库,这也是PHP获得成功的主 ......
MySQL EVENT
来源:http://samyu.blog.51cto.com/344284/146011
event_scheduler:
The MySQL event scheduler is a thread that runs in the background looking for events to execute. It spends a lot of time sleeping -- and won't do anything unless the new global variable "event_scheduler" is set t ......