当前位置: 动力学知识库 > 问答 > 编程问答 >

command line - Run MySql script as batch file on Windows Server

问题描述:

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

分享给朋友:
您可能感兴趣的文章:
随机阅读: