Home > database >  Workbench import CSV, failure, line1 grammatical errors
Workbench import CSV, failure, line1 grammatical errors

Time:10-03

New text with notepad, save as CSV (utf-8 encoding) :

A, B, C
D, E, F

Then in the workbench 6.3 CE with built-in import tool to import, obtain the following results:
Restoring the C: \ ProgramData/MySQL/MySQL Server 5.7 \ Uploads \ 3. CSV
Running: mysql. Exe - defaults - file="c: \ users \ admin \ appdata \ local \ temp \ tmpw34unc CNF" - protocol=TCP - host=localhost - user=root - port=3306 - default - character - set=utf8 - comments & lt; "C: \ \ ProgramData \ \ MySQL \ \ MySQL Server 5.7 \ \ Uploads \ \ 3. CSV"
ERROR 1064 (42000) at line 1: You have an ERROR in your SQL syntax; Check the manual that corresponds to your MySQL server version for the right syntax to use near 1, 2, 3
'A, B, C
D, E, F 'at line 1

Operation failed with exitcode 1
17:40:41 Import of C: \ ProgramData/MySQL/MySQL Server 5.7 \ Uploads \ 3. CSV has finished with 1 errors

Think impassability, please tall person to give directions, I now can only build a first field table, and then delete the title of the CSV part, and then use the load data infile method to import

CodePudding user response:

Can't directly import should use the load data import command

CodePudding user response:

See the information, it seems that you are using is not imported, is performed

CodePudding user response:

A detailed description of your rob to process

CodePudding user response:

reference 1st floor rucypli response:
can't directly import should load data using the import command

Is not directly import a file to automatically identify, create and import the data, and only establish good form structure first, and then use the load data infile method to import data, is it?
If so, then import the use of the file is the first line contains the title? Because I see the load data infile method there is no option to identify any title
But the import and the load data infile is actually a function? The import is actually with the load data?

CodePudding user response:

reference ZJCXC reply: 3/f
specific description of your rob to process does

I just click on the left in the workbench of the import, selected the path to the file to import, then click import, that's it, prompt every time the first line of error
Ask god to help look at the 4th floor, I was right

CodePudding user response:

I found only one using the wizard, the first step to choose the file name, the second step is setting the table name, the third step confirm fields, and then the import

CodePudding user response:

Look from your error message
Mysql. Exe - defaults to the file="c: \ users \ admin \ appdata \ local \ temp \ tmpw34unc CNF" - protocol=TCP - host=localhost - user=root - port=3306 - default - character - set=utf8 - comments & lt; "C: \ \ ProgramData \ \ MySQL \ \ MySQL Server 5.7 \ \ Uploads \ \ 3. CSV"

You this is an executing SQL operations, to execute the SQL to obtain from you to import files, and data is written in your file, not SQL, so I don't know how do you figure out the operation