2 Replies - 2331 Views - Last Post: 07 May 2012 - 03:39 AM

#1 rjohn5854  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 172
  • Joined: 04-October 11

Can't Retrieve Data from txt file to MySQL database

Posted 01 May 2012 - 06:14 AM

Can someone tell me what to fix ?

mysql> LOAD DATA INFILE' /Applications/MAMP/htdocs/team_stats.txt'
    -> INTO TABLE teamstats;
ERROR 13 (HY000): Can't get stat of '/usr/local/mysql/data/ /Applications/MAMP/htdocs/team_stats.txt' (Errcode: 2)
mysql> LOAD DATA INFILE '/Applications/MAMP/htdocs/team_stats.txt'
    -> INTO TABLE teamstats;
ERROR 13 (HY000): Can't get stat of '/Applications/MAMP/htdocs/team_stats.txt' (Errcode: 2)
mysql> 



Is This A Good Question/Topic? 0
  • +

Replies To: Can't Retrieve Data from txt file to MySQL database

#2 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3712
  • View blog
  • Posts: 5,964
  • Joined: 08-June 10

Re: Can't Retrieve Data from txt file to MySQL database

Posted 06 May 2012 - 03:46 PM

I would guess this is a permission issue. The user running the MySQL daemon must have the ability to read the file, or it can load it.

Of course, the first command is failing because of the added space in front of the path, but the second one should be fine.
Was This Post Helpful? 0
  • +
  • -

#3 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6039
  • View blog
  • Posts: 23,440
  • Joined: 23-August 08

Re: Can't Retrieve Data from txt file to MySQL database

Posted 07 May 2012 - 03:39 AM

Should be fine provided the file exists at the path given, of course. As well has the proper permissions.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1