错误代码:1193未知的系统变量

时间:2017-01-21 23:53:15

标签: mysql error-code import-csv

我尝试从.csv文件中导入数据,并且我收到了错误代码1193未知的系统变量。我正在使用MySql 5.5.34。

LOAD DATA LOCAL INFILE 'path to the file/student_2.csv' 
INTO TABLE STUDENT
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 2 LINES
(S_ID, S_LAST, S_FIRST, S_MI, S_ADDRESS, S_CITY, S_STATE, S_ZIP, S_PHONE, S_CLASS, @S_DOB, S_PIN, F_ID, @DATE_ENROLLED);
SET S_DOB = STR_TO_DATE(@S_DOB, '%m/%d/%Y'),
DATE_ENROLLED = STR_TO_DATE(@DATE_ENROLLED, '%m/%d/%Y');

csv个文件数据如下......

S_ID,S_LAST,S_FIRST,S_MI,S_ADDRESS,S_CITY,S_STATE,S_ZIP,S_PHONE,S_CLASS,S_DOB,S_PIN,F_ID,DATE_ENROLLED
Number,String,String,String,String,String,String,String,String,String,Date/Time,String,Number,String
1,Joffs,Tami,R,1817 Eagldge Cle,Houston,TX,74027,356487654,SR,7/14/88,8891,1,1/3/13
2,Petez,Jimmge,C,951 Drainbow Place,Absail,TX,76901,3253945432,SR,18/09/76,1230,1,11/10/02
3,Marks,Johannes,A,1015 Wild St,Dallas,TX,71012,3251454321,JR,08/13/83,1613,1,8/24/03
4,Smyth,Mark,,428 EN 16 Plaza,Arsehole,TX,7012,3221143210,SO,1/14/88,1841,2,8/23/04

我还将年份格式从%Y更改为%y,但也无效。 脚本有问题吗?

1 个答案:

答案 0 :(得分:1)

嗯 - 我无法尝试,但我没有深入了解您的脚本,但您确定import java.util.Scanner; import java.util.concurrent.FutureTask; import javafx.application.Application; import javafx.application.Platform; import javafx.scene.Scene; import javafx.stage.Stage; public class MyJavaProgram { public static void main(String[] args) throws Exception { // start FX toolkit on background thread: new Thread(() -> Application.launch(FXStarter.class)).start(); // wait for toolkit to start: FXStarter.awaitFXToolkit(); // make sure closing first window does not exit FX toolkit: Platform.setImplicitExit(false); int input; Scanner scanner = new Scanner(System.in); while (true) { System.out.println("0 - exit"); System.out.println("1 - display something to me"); input = scanner.nextInt(); switch (input) { case 0: break; case 1: // task to show UI: FutureTask<Void> showProgramTask = new FutureTask<>(() -> { MyJavaFXProgram program = new MyJavaFXProgram(); Stage stage = new Stage(); stage.setScene(new Scene(program.getView(), 400, 400)); stage.setOnShown(e -> { stage.toFront(); stage.requestFocus(); }); // showAndWait will block execution until window is hidden: stage.showAndWait(); return null ; }); // show UI on FX Application Thread: Platform.runLater(showProgramTask); // block until task completes (i.e. window is hidden): showProgramTask.get() ; break; } if (input == 0) break; } // all done, exit FX toolkit: Platform.exit(); scanner.close(); } } 之前的MyJavaFXProgram - 命令吗?

;