我正在准备一个脚本,以使用PowerShell“加载数据本地文件”。我将在任务计划中进行安装,如何在PowerShell上使用“加载数据本地文件”,我需要加载多个数据?
答案 0 :(得分:0)
mysql -h $dbhost -u $dbusername -p $dbpassword -D $dbname -e " `
LOAD DATA LOCAL INFILE 'C:/Users/My_PC/Downloads/file_1.csv' `
IGNORE INTO TABLE my_table FIELDS TERMINATED BY ',' IGNORE 1 LINES; `
LOAD DATA LOCAL INFILE 'C:/Users/My_PC/Downloads/file_2.csv' `
IGNORE INTO TABLE my_table FIELDS TERMINATED BY ',' IGNORE 1 LINES; `
LOAD DATA LOCAL INFILE 'C:/Users/My_PC/Downloads/file_3.csv' `
IGNORE INTO TABLE my_table FIELDS TERMINATED BY ',' IGNORE 1 LINES; "