var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Uploading CSV file to Mysql workbench
I am new here and new to sql.
I am running as local host on my machine and am using the Mysql workbench GUI.
I am trying to write a simple import script for a .csv file that I made for a one table DB call "song". The code looks as follows:
/* Import from C:\Testsong.csv*/
LOAD DATA INFILE 'C:\Testsong.csv'
INTO TABLE test.song
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
(Artist, Song_Name, Genre, Length_of_Track, Year_Track_Released)
The Testsong file is located in
'C:\ProgramData\MySQL\MySQL Server 5.5\Data\Testsong.csv' but the script is still able to read the file based on the path 'C:\Testsong.csv', why is that?
Also, How can I alter the script so that the first row of the .csv file is not read into the database?
Change the script to point to where the file actually is . . . You have told the process to use the file in the C:\ directory . . .
Possibly i have misunderstood?
See if the import allows skipping "header(s)" or the first "n" records. I am not familiar with MySql import.
Be careful using \ in Windows you need to provide \\ or alternatively you can use a single forward slash / instead of the backslash. This may have something to do with why the file was picked up C:filename.txt will use the default folder on the server and the filename.