mysql 问题汇总

来源:互联网 发布:知乎热门钓鱼贴 编辑:程序博客网 时间:2024/04/29 11:27

在表中添加col 

alter table user add time1 int not null;

旧数据此新加字段值都是0,如果没有not null,那么旧数据此值会是null

ALTER TABLE search_record ADD `send` INT default 0; 

这种方式更灵活


查看表的存储引擎

SHOW table status from nfyg where name='user';使用SHOW TABLE STATUS from 数据库库名 where Name=’表名’;

修改表的存储引擎

ALTER TABLE `tb_chengji` ENGINE = InnoDB;


select * from user where time1 in (select time2 from user);

UPDATE persondata SET age=age+1;
停止此次检测同步,下次程序再次启动处理








0 0
原创粉丝点击