Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Cannot find file in MySQL

Cannot find file in MySQL
Thread Tools
ballj35
Fresh-Faced Recruit
Join Date: Jul 2012
Status: Offline
Reply With Quote
Jul 30, 2012, 04:26 AM
 
Everyone,

I am trying to load a file into MySQL DB using the load statement and I keep getting the rror the file is not found, The command is as follows:

load data local infile '/usr/local/mysql-5.5.25a-osx10.6-x86/data/npidata_20050523-20120729.csv' into table nppes_data
fields terminated by ','
enclosed by '"'
lines terminated by '\r\n'
IGNORE 1 LINES;

Why does it not find the file. I do a GETINFO on the file and have copied the full path name and it still does not work. Thanx in advance.

Jerry
     
Gavin
Mac Elite
Join Date: Oct 2000
Location: Seattle
Status: Offline
Reply With Quote
Aug 1, 2012, 12:36 AM
 
Could be file permissions. Does mysql have read access? Do you?

try moving the file to your home folder


Also, you could use Sequel Pro to import the data using a nice GUI - you can avoid some command line headaches. http://www.sequelpro.com/
You can take the dude out of So Cal, but you can't take the dude outta the dude, dude!
     
ballj35  (op)
Fresh-Faced Recruit
Join Date: Jul 2012
Status: Offline
Reply With Quote
Aug 1, 2012, 03:36 AM
 
I change the file permissions from ./usr/* to have read/write. Got the same error. Then I just pointed towards
fthe file in the download folder and got the same results of not found.

Jerry
     
ballj35  (op)
Fresh-Faced Recruit
Join Date: Jul 2012
Status: Offline
Reply With Quote
Aug 1, 2012, 03:36 AM
 
set everyone to have read/write priv.
     
Gavin
Mac Elite
Join Date: Oct 2000
Location: Seattle
Status: Offline
Reply With Quote
Aug 1, 2012, 03:38 PM
 
are you using mysql or mysqlimport ? try mysqlimport


see this: https://bugs.launchpad.net/ubuntu/+source/mysql-dfsg-5.0/+bug/244406

or try setting the file owner to mysql
You can take the dude out of So Cal, but you can't take the dude outta the dude, dude!
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Aug 2, 2012, 09:07 AM
 
Originally Posted by ballj35 View Post

set everyone to have read/write priv.
But don't do this if you wish to keep your setup secure.
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Aug 2, 2012, 01:30 PM
 
Originally Posted by Gavin View Post
are you using mysql or mysqlimport ? try mysqlimport
see this: https://bugs.launchpad.net/ubuntu/+source/mysql-dfsg-5.0/+bug/244406
or try setting the file owner to mysql
As long as the file you are trying to read is world readable and the parent directories aren't blocking access, permissions shouldn't be the problem...

ballj35: can you paste in your entire command you are running as well as the entire error message?
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 07:03 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,