-1

I am trying to load a small file into a dummy table created on MYSQL but I get these below errors when I try running the commands.Please kindly help me regarding this. Thank you.

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
Teja
  • 13,214
  • 36
  • 93
  • 155

1 Answers1

0

I see a few potential problems.

  1. You need to create the table user
  2. You need to set the option local-infile=1 in MySQL (here)

  3. You may need to allow permissions for that user. If you want to do this quickly, you can use: GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';

Community
  • 1
  • 1
rick6
  • 467
  • 3
  • 8
  • 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 – Teja Feb 06 '15 at 20:34
  • local-infile is a parameter you can pass when you launch MySQL, or you can permanently add it to your my.cnf file. – rick6 Feb 06 '15 at 20:39