I am trying to transfer data from remote Server to localhost through MySQL.
In the remote server I created a database HOD and a table tab.
In the localhost I created the database "HOD" and a table "tab". I also created a stored procedure fed_procedure and federated table "fed_tab" to pull the data from remote table. The federated table "fed_tab" gets data from the remote server but the table "tab" updates only when I call the stored procedure using CALL fed_procedure(); I want the table "tab" to update automatically every 5 minutes. So I created an event schedule to update the table "tab" every 5 minutes. But when I execute it, I am getting the error :Access denied for user 'root'@'%' to database 'HOD'". How can I do this?
Below is the stored procedure I created and the event scheduler.
DELIMITER $$
DROP PROCEDURE IF EXISTS `HOD`.`fed_procedure` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `fed_procedure`()
BEGIN
declare tab_indx integer(11);
set tab_indx = (SELECT tab_ndx FROM tab order by tab_ndx desc limit 1);
insert into tab select * FROM fed_tab where tab_ndx>tab_indx;
END $$
DELIMITER ;
The event scheduler is below
CREATE EVENT fed_procedure ON SCHEDULE EVERY 5 minute
do
CALL fed_procedure()