我有一个要加载到MySQL数据库中的文本文件。

当我执行命令时:

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


我得到错误:

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


由于我认为这是一个许可问题,因此我使用了show grants命令,

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

GRANT ALL PRIVILEGES ON `saurabh`.* TO 'saurabh'@'localhost' .

最佳答案

见此帖子Mysql permission errors with 'load data'

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

10-04 10:37