mysql timer is the system to provide an event, and the timer inside Oracle is the system to provide the job. Less nonsense, create table below: Creation table mytable (id int auto_increment not null,name varchar (+) NOT NULL default ", introduce text not n Ull,createtime Timestamp not null,constraint pk_mytable primary key (ID)) Creates a stored procedure, Here the stored procedure is mainly provided to the MySQL timer event to invoke to execute: CREATE PROCEDURE Mypro () Begininsert into MyTable (name,introduce,createtime) values (' 1111 ', ' Inner Mongolia ', now ()); end; Here is just a simple write-up, just to illustrate the example. Immediately after creating the MySQL timer Event:create event if not exists eventjob on schedule every 1 second on completion Preservedo call Mypro (); is set to execute once every second. All the preparation work has been finished, and to do this, MySQL to use the timer must be ready to work, is to turn on the MySQL timer: set GLOBAL Event_scheduler = 1; --Start timer set GLOBAL Event_scheduler = 0; --The Stop timer is followed by the event: ALTER event eventjob on completion PRESERVE ENABLE; --Open event alter event eventjob on completion PRESERVE DISABLE; --Close event show VARIABLES like '%sche% '; --Check the timer status at this point, you go to the database inside the table mytable inside to see, the system will be every second to insert a data, hehe, the task is completed. SELECT * FROM MyTable
MySQL Create timer