请寻求一些建议:
我有一个MySQL 5.6事件调度程序设置如下:
DELIMITER $$
CREATE DEFINER=`root`@`10.0.0.%` EVENT `update_reports` ON SCHEDULE EVERY 3 MINUTE STARTS '2015-10-16 13:01:20' ON COMPLETION PRESERVE ENABLE DO update_reports:BEGIN
DECLARE triggered datetime DEFAULT SYSDATE();
DECLARE started datetime DEFAULT NULL;
DECLARE status tinyint(1) DEFAULT 0;
# LOGIC
IF wait_for_processing('reports.processing') THEN
SET started = SYSDATE();
# SET SESSION VARIABLES
SELECT enable_logging(false);
SELECT enable_debug_timers(true);
SET @reporting_from = '2013-03-01 00:00:00';
IF (needs_update()) THEN
SELECT update_usage_data();
SET status = 1;
ELSE
SET status = 2;
END IF;
SELECT free_for_processing('reports.processing');
END IF;
INSERT INTO ref.event_logs
SELECT
'reports',
'update_reports',
triggered,
started,
SYSDATE(),
null,
status;
END update_reports
但是,在MySql错误日志中,我收到此错误:
2015-10-16 13:37:20 29327 [ERROR] Event Scheduler: [root@10.0.0.%][reports.update_reports] Table 'reports.reporting_statsevent_logsuser_seen' doesn't exist
2015-10-16 13:37:20 29327 [Note] Event Scheduler: [root@10.0.0.%].[reports.update_reports] event execution failed.
数据库和表的权限显示为root@10.0.0.%以获得完全权限。
任何人都可以分享我可以采取的任何故障排除步骤,以了解事件调度程序无法访问表的原因,但在MySql Workbench中执行时查询工作正常。
谢谢。