MySQL Forums
Forum List  »  Newbie

Create even that updates tables/db every 5 minutes
Posted by: Marcus Dardy
Date: April 02, 2018 01:49PM

I want to create an event that runs every 5 minutes updates all of the tables in one server and updates them to another server. Is this possible? I currently have to export by creating to a self-contained file from one server and import that file into the other server.

Here is the script I have so far:

DELIMITER $$

DROP EVENT IF EXISTS run_event $$

CREATE DEFINER=`root`@`%`
EVENT `run_event`
ON SCHEDULE EVERY 5 MINUTE STARTS '2018-04-04 00:00:00'
ON COMPLETION NOT PRESERVE ENABLE
DO
BEGIN
SIGNAL SQLSTATE '01000' SET MESSAGE_TEXT = 'run_event started';
CALL my_db;
SIGNAL SQLSTATE '01000' SET MESSAGE_TEXT = 'run_event finished';
END $$

Options: ReplyQuote


Subject
Written By
Posted
Create even that updates tables/db every 5 minutes
April 02, 2018 01:49PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.