0

When I try open a script in the event scheduler with the source: c:/path/path/file.sql the following error occurs:


mysql> CREATE EVENT `TEST_load_import_script_user`
    -> ON SCHEDULE EVERY 1 DAY STARTS '2018-10-01 11:09:00'
    -> DO source c:/db/data_import/scripts/load_data_user.sql;

See Error:

*ERROR 1064 (42000): You have an error in your SQL syntax; check the manual 
that corresponds to your MySQL server version for the right syntax to use near 
'c:/db/data_import/scripts/load_data_user.sql' at line 3*

BUT when I do a simple "Select * from" Command all works as expectet:

mysql> CREATE EVENT `TEST_load_import_script_user`
    -> ON SCHEDULE EVERY 1 DAY STARTS '2018-10-01 11:09:00'
    -> DO select * from user;

Query OK, 0 rows affected (0.06 sec)


Does anyone know what I am doing wrong? :)


Additional Information that might help:

  • I am running MySQL 8.0 on Windows Server 2016 Yes the File does exist
  • When I try to run the script outside of the Event Scheduler Syntax, no error is given and the script is being executed normally
  • Event scheduler is ON
Lewis Browne
  • 904
  • 7
  • 23
Alan Rellek
  • 247
  • 1
  • 8
  • source is meant to use differently https://dev.mysql.com/doc/refman/8.0/en/mysql-batch-commands.html.. – Raymond Nijland Oct 01 '18 at 12:29
  • 'Each stored program contains a body that consists of an SQL statement. This statement may be a compound statement made up of several statements separated by semicolon (;) characters.' https://dev.mysql.com/doc/refman/8.0/en/stored-programs-defining.html (an event is a stored program). – P.Salmon Oct 01 '18 at 12:37

0 Answers0