MySQL Forums
Forum List  »  Newbie

Unable to use Upload command on machine that is running MySQL and contains file to uploau
Posted by: David Figgat
Date: November 20, 2018 11:42AM

I am trying to load some data on the machine that mysql is running on
using a load data local infile command and getting some errors. Below
are the steps and commands I have used. Please let me know how to
resolve.

CREATE TABLE `website_visits` (
`ID` int(11) NOT NULL,
`CUSTOMER_NAME` varchar(255) DEFAULT NULL,
`CUSTOMER_TYPE` int(11) DEFAULT NULL,
`DATE_STARTED` datetime DEFAULT NULL,
`DURATION` double DEFAULT NULL,
`GENDER` varchar(45) DEFAULT NULL,
`AGE` int(11) DEFAULT NULL,
`SALARY` int(11) DEFAULT NULL,
`REVIEW_DURATION` double DEFAULT NULL,
`RELATED_DURATION` double DEFAULT NULL,
`PURCHASED` int(11) DEFAULT 0,
`IS_MALE` int(11) DEFAULT NULL,
`IS_FEMALE` int(11) DEFAULT NULL,
`VIEWED_REVIEW` int(11) DEFAULT NULL,
`VIEWED_RELATED` int(11) DEFAULT NULL,
`AGE_RANGE` varchar(255) DEFAULT NULL,
`SALARY_RANGE` varchar(255) DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ***********************************************************
-- Disable checks for insert of every row. This makes loading
-- really fast
-- ***********************************************************

set unique_checks = 0;
set foreign_key_checks = 0;
set sql_log_bin=0;
set autocommit = 0;

-- ***********************************************************
-- Load the csv file
-- ***********************************************************

SET GLOBAL local_infile=ON;

LOAD DATA LOCAL INFILE
"C:\ProgramData\MySQL\MySQL Server
8.0\Uploads\website_visits_data.csv"
INTO TABLE `website_visits`
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 LINES
(ID, CUSTOMER_NAME, CUSTOMER_TYPE, DATE_STARTED, DURATION,

GENDER,AGE,SALARY,REVIEW_DURATION,RELATED_DURATION,PURCHASED);

Error I receive
15:45:40 LOAD DATA INFILE "C:\ProgramData\MySQL\MySQL Server
8.0\Uploads\website_visits_data.csv" INTO TABLE `website_visits`
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED
BY '\n' IGNORE 1 LINES (ID, CUSTOMER_NAME, CUSTOMER_TYPE,
DATE_STARTED, DURATION,
GENDER,AGE,SALARY,REVIEW_DURATION,RELATED_DURATION,PURCHASED)
Error Code: 1290. The MySQL server is running with the
--secure-file-priv option so it cannot execute this statement 0.000
sec

Does anybody know how to resolve this one?

Options: ReplyQuote


Subject
Written By
Posted
Unable to use Upload command on machine that is running MySQL and contains file to uploau
November 20, 2018 11:42AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.