rondog Posted March 6, 2008 Share Posted March 6, 2008 I am trying to use LOAD DATA INFILE to load CSV file. I am using this query: LOAD DATA INFILE 'http://www.website.com/new/new_dec/store.csv' INTO TABLE ssp_dealers FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (customer, street1, street2, city, state, zip) Its is throwing this error at me: /* SQL Error: Access denied for user 'user'@'%' (using password: YES) */ I emailed support and they said I have every privilege except GRANT and told me to check my SQL statement. Is their something wrong with it?? Quote Link to comment Share on other sites More sharing options...
bpops Posted March 6, 2008 Share Posted March 6, 2008 May be a stupid question, but you HAVE connected to the server and selected a database before this query, right? Cause it just looks like you don't have the right username/pass. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted March 6, 2008 Share Posted March 6, 2008 they have a connection with an invalid username Quote Link to comment Share on other sites More sharing options...
rondog Posted March 6, 2008 Author Share Posted March 6, 2008 Well I am using Heidi SQL to connect remotely with username and password..I can run querys through the query window..it just doesnt seem to let me do load data infile cooldude: what do u mean "they have a connection with an invalid username". is 'they' the host or are you referring to me? Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted March 6, 2008 Share Posted March 6, 2008 how about u show us the whole script instead of an irrelevant line. Quote Link to comment Share on other sites More sharing options...
rondog Posted March 6, 2008 Author Share Posted March 6, 2008 I did...this is the actual SQL command I used minus the website name LOAD DATA INFILE 'http://www.website.com/new/new_dec/store.csv' INTO TABLE ssp_dealers FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (customer, street1, street2, city, state, zip) Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted March 6, 2008 Share Posted March 6, 2008 your error is in the connection not the sql line Quote Link to comment Share on other sites More sharing options...
rondog Posted March 6, 2008 Author Share Posted March 6, 2008 So i am using the wrong username/password you think? I can connect to the database with the given IP address, username and password. Never had this problem before. I'll talk to my client and see what they say. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted March 6, 2008 Share Posted March 6, 2008 well the user you are using is most likely not the dba thus a load data infile is failing. Try and verify you can select/delete first Quote Link to comment Share on other sites More sharing options...
rondog Posted March 6, 2008 Author Share Posted March 6, 2008 I have verified I can select and delete. I think your right when you say I am most likely not the dba. I will contact the client/their host to try and get this issue resolved. Thanks very much Quote Link to comment Share on other sites More sharing options...
rondog Posted March 6, 2008 Author Share Posted March 6, 2008 ok ok i figured it out... LOAD DATA LOCAL INFILE 'C:/Documents and Settings/dop.OCTIUM3G/Desktop/store.csv' INTO TABLE ssp_dealers FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (customer, street1, street2, city, state, zip) I was thinking it was looking for a file locally on the server side...I point it to my computer path name and it loaded up.. the only thing in the last field where ZIP is it has the zip code like this: 92026[] I cant make the character because its invisible, but basically its adding the line break as a character into the field..it looks like a block. Any reason its doing that? Im pretty sure I can use a while loop in PHP and update that field with only 5 characters cutting that line break off. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.