Sharpeye500
Sharpeye500

Reputation: 9063

Scheduler in mysql

Is there any option in MySQL to run 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.

Upvotes: 1

Views: 161

Answers (2)

nos
nos

Reputation: 229058

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 ..... ;

Upvotes: 4

Yanick Rochon
Yanick Rochon

Reputation: 53531

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

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

Upvotes: 0

Related Questions