problem locating a file with mysql

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
aussie_clint
Forum Commoner
Posts: 41
Joined: Mon Jul 31, 2006 9:14 am
Location: Brisbane, Australia
Contact:

problem locating a file with mysql

Post by aussie_clint »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


im trying to run this sript and its saying the file is not found
[quote]File '\home\computer\public_html\cw.csv' not found (Errcode: 2)[/quote]

from the web site of my hosting (http://www.mdwebhosting) it has the dirctory structor as:

[quote]
Path to User files The path to your user files on Hosting, Budget Hosting, Linux Reseller Hosting, eShops is /home/username/public_html (replace username with your hosting name)  
[/quote]


[syntax="sql"]
LOAD DATA LOCAL INFILE '/home/computer/public_html/cw.csv'
INTO TABLE `newprice list`
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
can someone let me know where im going rong

thanks[/quote]


feyd | Please use[/syntax]

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Looks like there is no such file on the webserver. Please post the relevant part of your php(?) script.
aussie_clint
Forum Commoner
Posts: 41
Joined: Mon Jul 31, 2006 9:14 am
Location: Brisbane, Australia
Contact:

Post by aussie_clint »

Code: Select all

LOAD DATA LOCAL INFILE '/home/computer/public_html/cw.csv' 
the file is there and they say im useing the right directory but its not working
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

eh... I thought you post more code, not less than in the first post. You used

Code: Select all

tags, so I guess there's a php script surrounding the sql query?
aussie_clint
Forum Commoner
Posts: 41
Joined: Mon Jul 31, 2006 9:14 am
Location: Brisbane, Australia
Contact:

Post by aussie_clint »

im just useing that code trough mysql query browser, and iv copied the csv file into the that directory on my server
User avatar
mikeq
Forum Regular
Posts: 512
Joined: Fri May 03, 2002 3:33 am
Location: Edinburgh, Scotland

Post by mikeq »

Just because their documentation says the location of your home directory does not mean it is correct.

They may have changed the server config and not updated their documentation, surely not :roll:

I would email the host and ask them.

Do you have shell access to the server?

What about permissions on the file. If the webserver user (thats what php myadmin will be running as) doesnt have read access to the file will it produce that error?

Try chmod 777 on your file to see if it works
Post Reply