开发者

Scheduler in mysql

Is there any option in MySQL to r开发者_运维技巧un a scheduler job? At end of the day take some records from table1 (last 3 weeks days via sql query) and transfer to another db's table.

Please give some heads up on this.

Thanks.


Yes, there's the event scheduler (since MySQL 5.1.6)

CREATE EVENT myevent
    ON  SCHEDULE EVERY 1 DAY
    DO
      insert into mydb.mytable select something,anything from otherdb.othertable where ..... ;


no, but you can use a cron job to execute the mysql command :

mysql <my_db_name> -u<user_name> -p<password> <mysql.sql>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜