0

How can I load data to a MySQL server from a text file that is on my computer? I follow the procedure I found in this former question, but I think it is required for you to have the data file on your server. If I try, I receive an #1045 - Access denied for user 'learnsql'@'localhost' (using password: NO). I do not know if the two things are related.

I ran:

 LOAD DATA INFILE  'C:\Users\Me\Google Drive\dataset\userid-timestamp-artid-artname-traid-traname.tsv' INTO TABLE dataset 
Community
  • 1
  • 1
Edgar Derby
  • 2,543
  • 4
  • 29
  • 48

1 Answers1

1

The "learnsql" user must have FILE privileges.

grant file on *.* to user@localhost identified by 'password';

And MySQL must have operating system access to files, of course.

vidario
  • 479
  • 2
  • 5
  • Hi, @vidario, thank you for the advice. My knowledge of MySQL is lacking, which part of your query should I edit in order to use it? Because if I try to run it as it is I receive the same error: "#1045 - Access denied for user 'learnsql'@'localhost' (using password: NO)". Also, once I have the file privileges, can I load data from my machine or do have I to upload the file on the server trough FTP? – Edgar Derby Aug 17 '13 at 11:46