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

mysql 常用举例

drop table student;
create table student
(sno   int   not null unique,
 sname varchar(8) not null,
 ssex  char(2)    not null,
 sage int ,
 sdept varchar(20));
 
 select * from student;
 alter table student drop unique(sno);
 alter table student modify sno primary key;
 alter table student add constraints con_s check(ssex in('F', 'M'));
 
 insert into  student values ('0001', 'zhangwen', 'F', 24, 'math');
 insert into  student values ('0201', 'zhangzi', 'F', 24, 'jsj');
 insert into  student values ('0002', 'wangjing', 'M', 22, 'math');
 insert into  student values ('0301', 'lilu', 'M', 23, 'wuli');
 insert into  student values ('0003', 'wujun', 'M', 24, 'math');
 insert into  student values ('0202', 'wangli', 'F', 23, 'jsj');
 insert into  student values ('0203', 'jiangmin', 'M', 23, 'jsj');
 insert into  student values ('0302', 'lixiang', 'F', 23, 'wuli');
 insert into  student values ('0303', 'jinmin', 'F', 24, 'wuli');
 insert into  student values ('0304', 'jinmin', 'F', null, 'wuli');
 insert into  student values ('0204', 'jinmin', 'F', 22, '');
 delete from student where sno = '0204';
 update student set sname = 'luyong' where sno = '0304';
 insert into student values('0004','meinv','M',22,'math');
 insert into student values('0006','beauty','M',21,'math');
 ----------------------------------------------
 drop table course;
 create table course(cno int primary key,
                     cname varchar2(10) not null,
                     ccredite float(2));
        


相关文档:

MySQL的datetime设置当前时间为默认值


MySQL的datetime设置当前时间为默认值 
由于MySQL目前字段的默认值不支持函数,所以用
create_time datetime default now()
的形式设置默认值是不可能的。
代替的方案是使用TIMESTAMP类型代替DATETIME类型。
CURRENT_TIMESTAMP :当我更新这条记录的时候,这条记录的这个字段不会改变

CURRENT_TIMESTAMP O ......

MySQL数据库文件介绍

本文链接http://www.chysoft.net/files/article_234.htm 更多资讯请进入www.chysoft.net 
mysql的数据储存目录在mysql的配置文件my.ini文件设置,格式如下:
# Uncomment the following rows if you move the MySQL distribution to another
# location
basedir = d:/cyoa/mysql_cy/
datadir = d:/cyoa/mysq ......

JDBC+MySQL连接池

1.创建一个java project项目pooling
2.为项目添加MySQL连接驱动
3.为项目添加一个配置文件dbpool.proprerties
Code
driverClassName=com.mysql.jdbc.Driver
username=root
password=
url=jdbc:mysql://localhost:3306/work
poolSize=10
 
4.分别创建一个连接类ConnectionPool.java和一个测试类ConnectionPoo ......

Mysql的存储引擎


<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@宋体" ......

MySQL数据库备份与恢复

方法一:
1.导出整个数据库
命令行进入到mysql安装目录的bin目录下
假设装在D:/mysql/bin
即:开始 运行 输入cmd
d:
cd mysql/bin
然后执行下面语句
mysqldump -u 用户名 -p 数据库名 > 导出的文件名  
示例:mysqldump -u root -p sq_wcnc > d:\wcnc.sql
2.恢复数据库
   常用source 命令 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号