我正在尝试将一个小文件加载到在MYSQL上创建的虚拟表中,但是当我尝试运行命令时,我得到以下错误。请帮我解决这个问题。谢谢。
mysql> LOAD DATA INFILE '/Users/ravitejavutukuri/Desktop/Acme Reports/abc.txt' INTO TABLE dummy FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
ERROR 1045 (28000): Access denied for user ''@'localhost' (using password: NO)
mysql> LOAD DATA LOCAL INFILE '/Users/ravitejavutukuri/Desktop/Acme Reports/abc.txt' INTO TABLE dummy FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
ERROR 1148 (42000): The used command is not allowed with this MySQL version
mysql> LOAD DATA INFILE '/Users/ravitejavutukuri/Desktop/Acme Reports/abc.txt' INTO TABLE dummy FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
ERROR 1045 (28000): Access denied for user ''@'localhost' (using password: NO)
mysql> local-infile=1
-> ;
ERROR 1064 (42000): 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 'local-infile=1' at line 1
答案 0 :(得分:0)
我看到了一些潜在的问题。
user
您需要在MySQL中设置选项local-infile=1
(here)
您可能需要允许该用户的权限。如果您想快速执行此操作,可以使用:GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';