开发者

Scheduler in mysql

开发者 https://www.devze.com 2023-01-14 10:44 出处:网络
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.

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

精彩评论

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