问题描述:

I have about 3 or so weekly generated .CSV files that are automatically placed in a particular directory on my MySQL box.

What I would like to do is run some sort of automated script that opens the MySQL command line and executes a query to delete all records in the corresponding table and LOAD DATA INFILE from the CSV's.

Being that I'm on Windows I cannot do a chronjob, though I was thinking I could do some sort of batch script and run it as a Scheduled Task.

Any idea how I would go about doing this?

网友答案:

Depending on your MySQL version you could use CREATE EVENT to schedule some database statements, check:

http://dev.mysql.com/doc/refman/5.1/en/create-event.html

相关阅读:
Top