LOAD DATA Question

Hey guys,

First of all this is my first post at sitepoint, a person on another forum showed me this site and I am glad he did. Unfortunately I am running into a problem when I try to populate a table with a text file that I have hosted in my public_html file.

I am using phpMyAdmin and the Query to load the data is this:

LOAD DATA
INFILE ‘http://www.mywebsite.com/calendar.txt
INTO TABLE calendar
LINES TERMINATED BY '\r

IGNORE 1 LINES

;

and I get the error:

#1045 - Access denied for user ‘andyinsd’@‘localhost’ (using password: YES)

I thought this was because I have made a database user account that has a different username and password then my cpanel login. So I wrote a PHP script which connects to the server, selects the database and tries to execute the same query:

$result = mysql_query ("

				   LOAD DATA
INFILE 'http://www.mywebsite.com/calendar.txt'
INTO TABLE calendar
LINES TERMINATED BY '\\r\


IGNORE 1 LINES

");

I have used both usernames and passwords, and still haven’t got anything to work. The script is connecting the database just fine as I can query SELECT statements. However populating this one table with this text file has become quite the labor intensive project. Also my host is hostgator if thats of any help.

UPDATE:

I added this to the php script:

if( !$result)
{
die(“Table did not populate” . mysql_error());
}

This resulted in the same error message; Access denied for user ‘whatever_Username_itried’@‘localhost’ (using password: YES)

I’m assuming this is something only gator host can fix.

Thanks,

Andy

once you get over your password issues, you might have to change the way you’re specifying the source file