一,借鉴[luo奔的蜗牛] 1.创建一张表 create table mytable ( id int auto_increment not null, name ) not null default '', introduce text not null, createtime timestamp not null, constraint pk_mytable primary key(id) ) 2.创建存储过程 --创建存储过程,这里的存储过程主要提供给mysql的定时器event来调用去执…
mysql定时器是系统给提供了event,而oracle里面的定时器是系统给提供的job.废话少说,下面创建表: create table mytable ( id int auto_increment not null, name varchar(100) not null default '', introduce text not null, createtime timestamp not null, constraint pk_mytable primary key(id) ) 创建存…
1.查看是否开启evevt与开启evevt. 1.1.MySQL evevt功能默认是关闭的,可以使用下面的语句来看evevt的状态,如果是OFF或者0,表示是关闭的. show VARIABLES LIKE '%sche%'; 1.2.开启evevt功能 SET GLOBAL event_scheduler = 1; 2.创建定时器的过程 2.1.创建测试表test drop table if exists test; create table test ( id int(11) not nu…
mysql定时器是系统给提供了event,而oracle里面的定时器是系统给提供的job.废话少说,下面创建表: create table mytable ( id int auto_increment not null, name varchar(100) not null default '', introduce text not null, createtime timestamp not null, constraint pk_mytable primary key(id) ) 创建存…
经常要周期性的执行某一个命令或者SQL语句.mysql事件,mysql的版本是5.1以上. 首先要查看事件是否开启了, SHOW VARIABLES LIKE 'event_scheduler'; SELECT @@event_scheduler; SHOW PROCESSLIST; 之星sql 开启mysql事件,1,通过动态参数修改:SET GLOBAL event_scheduler = ON;注意:还是要在my.cnf中添加event_scheduler=ON.因为如果没有添加的话,my…