I am trying to load a CSV file from a remote server into an AWS mySQL table.
I get an Error 1045 (Access denied) when running mysql script to LOAD DATA INFILE from the remote server.
If I paste the URL of the csv file into a browser it downloads as a CSV. So there doesn't seem to be an authentication issue with it.
If I store the csv locally and use LOAD DATA LOCAL INFILE it uploads to the mySQL table - Successful.
The command I am using in mySQL Workbench is this:
LOAD DATA INFILE 'http://geoserver-rls.imas.utas.edu.au/geoserver/RLS/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=RLS:SpeciesSurvey&outputFormat=csv'
INTO TABLE staging.locations
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 ROWS
This SQL will build the locations table
CREATE TABLE `locations` (
`FID` text,
`SpeciesID` int(11) DEFAULT NULL,
`SurveyID` int(11) DEFAULT NULL,
`SiteLongitude` double DEFAULT NULL,
`SiteLatitude` double DEFAULT NULL,
`Realm` text,
`Country` text,
`State` text,
`geom` text,
`key` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
The exact error message is here: Error Code: 1045. Access denied for user ''@'%' (using password: YES) 0.188 sec
My question is: 1) what can I do to get around this access denied error when I'm running this from within the Workbench environment - which is allowed read/write access to the database?
Thank you.
John.