简单学习mysql日志管理

本文主要给大家介绍mysql日志管理,文章内容都是笔者用心摘选和编辑的,具有一定的针对性,对大家的参考意义还是比较大的,下面跟笔者一起了解下mysql日志管理吧。                                                        

创建一个表

    create table test_student(
         id int auto_increment,
         firstName varchar(10) not null,
         lastName varchar(10) nont null,
         addtime date,
         primary key(id)
    
    )engine=innodb character set=utf8
    
插入语句

insert into test_student set firstName="zhang",lastName="san",addtime='2001-02-02';

insert into test_student set firstName="zhang",lastName="tian",addtime='2001-03-02';

insert into test_student set firstName="li",lastName="tian",addtime='2003-03-02';

查找 addtime 在等于 3月份的学生

select * from test_student where month(addtime)='03';

查找 addtime 等于 2001 年的学生

select * from test_student where year(addtime) ='2001';

//日期函数
// 返回日期date是星期几(1=星期天,2=星期一,……7=星期六,ODBC标准)
select dayofweek('2017-04-22') 返回  7;

看完以上关于mysql日志管理,很多读者朋友肯定多少有一定的了解,如需获取更多的行业知识信息 ,可以持续关注我们的行业资讯栏目的。