Access denied error

legalg

Guppy
I am attempting to run a php script to import a .csv file into a table. It is a very simple process. However, I keep getting "access denied for user."

Here is the error:
Import Error: Access denied for user 'username'@'%' (using password: YES)
 
Yes. Sorry for not mentioning. MySQL.

Here is the script i am trying to run to import the .csv into may table.

<?php

$conn = mysql_connect('mysql1.g********.com','xxxxxx','xxxxxx');

mysql_select_db('ryanwoo_map');

mysql_query("TRUNCATE TABLE ryanwoo_csvimport") or die(mysql_error());

mysql_query("LOAD DATA INFILE 'arrestlistNEW.csv'
INTO TABLE ryanwoo_csvimport
fields terminated by ',' ENCLOSED BY '\"'
LINES terminated by '\r\n'(
name
,address
,charge
,lat
,lng)") or die("Import Error: " . mysql_error());

?>
 
I am not sure how the CSV file is getting to the server? I think that may be the issue here, since the csv file is remote from the SQL server, I don't know how that command would work. I am by no means a MySQL expert so I could be wrong ;)
 
I am trying to run an automated mysql csv import. I do not want to have manually import a csv file into my table everytime, it will make it impossible.

Is there any workaround to setting up an automatic import or import script?
 
Not in that manner no, since the mySQL is not local it cannot access the file.
 
Back
Top