0

I have a text file which I want to load into a MySQL database.

When I execute the command:

load data infile '/saurabh/chk1.txt'
   into table chk1 fields terminated by '\t' lines terminated by '\n';

I get the error:

ERROR 1045 (28000): Access denied for user 'saurabh'@'localhost' (using password: YES)

Since I thought this was a permissioning problem, I used show grants command,

GRANT USAGE ON *.* TO 'saurabh'@'localhost' IDENTIFIED BY PASSWORD '*40639DEF' 

GRANT ALL PRIVILEGES ON `saurabh`.* TO 'saurabh'@'localhost' .
Ganesh Sittampalam
  • 28,821
  • 4
  • 79
  • 98
Saurabh
  • 913
  • 3
  • 12
  • 15
  • Welcome to Stack Overflow! I cleaned up your question a bit and indented your code and error messages by 4 spaces so that they render properly - please see [the editing help](http://stackoverflow.com/editing-help) for more information on formatting. – Ganesh Sittampalam Apr 08 '15 at 00:23

2 Answers2

0

See this post Mysql permission errors with 'load data'

Try: grant file on *.* to saurabh@localhost identified by 'saurabh'

Community
  • 1
  • 1
AndreiDMS
  • 373
  • 3
  • 7
0

Try placing the file you want to load in the Public directory (C:\Users\Public) and after that try to load it again. That is what fixed the problem for me.