Suppose the current date is 20141110 10:00pm , I would like to let mysql to update a field and then dump few fields into a file while the date is 20141201 10:00pm
how to implement it?
What I know is to use event, but this seems to be used under some interval time. like every few hours/days/weeks to make the event happen.
Mysql events is good option or you can use database triggers if you have older version of mysql.
http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html http://www.mysqltutorial.org/mysql-triggers/working-mysql-scheduled-event/
You can declare a fixed point in time for the event's schedule. The interval part is optional.
Here's an example that appears on manual page http://dev.mysql.com/doc/refman/5.6/en/create-event.html
Note also that you do not have to use a stored procedure.
You will need a stored procedure to execute the code. It is a place where you can have if/else/white.......working with sp
Then you will need an event to call the procedure at any schedule time.
You have to make sure event-scheduler is turned on in mysql