Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create a schedule and MYSQL loading csv data to table

Status
Not open for further replies.

jyothi12389

Programmer
Mar 13, 2016
2
US
Hi,

The below code is working in MySql Workbench.

SET GLOBAL local_infile = true;
LOAD DATA INFILE
"C:/ProgramData/MySQL/MySQL Server 8.0/Uploads/test.CSV"
INTO TABLE testDB.tbl
character set latin1
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
IGNORE 1 LINES;

But I want to schedule the dataloading to mysql table:

the below code is not working:
SET GLOBAL event_scheduler = ON;
DELIMITER $

CREATE
EVENT `testjayaEvent`
ON SCHEDULE EVERY 5 MINUTE STARTS '2021-02-16 00:00:00'
DO
BEGIN
LOAD DATA INFILE
"C:/ProgramData/MySQL/MySQL Server 8.0/Uploads/test.csv"
INTO TABLE testDB.tbl
character set latin1
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
IGNORE 1 LINES;
END $
DELIMITER ;


please assist me in this regard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top