时间:2017年04月08日 | 作者 : aaronyang | 分类 : 数据库 | 浏览: 1263次 | 评论 0 人
查看数据库
查看默认存储引擎
查看支持的存储引擎
show variables like 'have%';
use world; create table test1 ( i int not null auto_increment, primary key(i) ) engine=MyISAM;
查看表的创建
====================www.ayjs.net 杨洋 wpfui.com ayui ay aaronyang=======请不要转载谢谢了。=========
自动增长
对于innodb表,自动增长列必须是索引。如果是组合索引,也必须是前导列
create table innodb_testauto ( id1 int not null auto_increment, id2 int not null, val varchar(10), index(id2,id1) ) engine=innodb;
create table myisam_testauto ( id1 int not null auto_increment, id2 int not null, val varchar(10), index(id2,id1) ) engine=myisam;
插入数据
insert into myisam_testauto(id2,val) values(2,'2'),(3,'3'),(4,'4'),(5,'5'),(2,'2'),(3,'3'),(4,'4');
insert into myisam_testauto(id2,val) values(3,'3'),(4,'4');
由以上实验可以看出对于组合索引 id1,id2 插入一些数据,自动组合列是根据组合索引的第一列d2 进行排序后递增的
www.ayjs.net 六安杨洋(AY)拓展
======================================== AYUI www.ayjs.net AY ===============
推荐您阅读更多有关于“mysql,”的文章
抖音:wpfui 工作wpf
目前在合肥企迈科技公司上班,加我QQ私聊
2023年11月网站停运,将搬到CSDN上
AYUI8全源码 Github地址:前往获取
杨洋(AaronYang简称AY,安徽六安人)和AY交流
高中学历,2010年开始web开发,2015年1月17日开始学习WPF
声明:AYUI7个人与商用免费,源码可购买。部分DEMO不免费
查看捐赠AYUI7.X MVC教程 更新如下:
第一课 第二课 程序加密教程
额 本文暂时没人评论 来添加一个吧
发表评论