'How to fix Error Code: 2068. LOAD DATA LOCAL INFILE file request rejected due to restrictions on access?
When I execute the code below I get Error Code: 29. File '/Applications/XAMPP/xamppfiles/htdocs/Gefle442/csv/places.csv' not found (Errcode: 13 "Permission denied")
USE Gefle442;
CREATE USER IF NOT EXISTS 'jim'@'localhost' IDENTIFIED BY 'x';
GRANT ALL ON games.* TO 'jim'@'localhost';
SET NAMES 'utf8mb4';
SET GLOBAL local_infile = "ON";
DROP TABLE IF EXISTS gamestats;
DROP TABLE IF EXISTS games;
DROP TABLE IF EXISTS arenas;
DROP TABLE IF EXISTS standings;
DROP TABLE IF EXISTS formations;
DROP TABLE IF EXISTS competitions;
DROP TABLE IF EXISTS people;
DROP TABLE IF EXISTS teams;
DROP TABLE IF EXISTS places;
CREATE TABLE places (
ID integer(5) unique not null,
Place varchar(40),
Municipality varchar(40),
Country varchar(40),
Continent varchar(40),
PRIMARY KEY (ID)
)
ENGINE INNODB
CHARSET utf8mb4
COLLATE utf8mb4_swedish_ci
;
LOAD DATA INFILE '/Applications/XAMPP/xamppfiles/htdocs/Gefle442/csv/places.csv'
INTO TABLE places
CHARACTER SET utf8mb4
FIELDS OPTIONALLY ENCLOSED BY '"'
TERMINATED BY ','
LINES
TERMINATED BY '\r\n'
IGNORE 1 LINES
;
I've tried using LOAD DATA LOCAL INFILE which gives me Error Code: 2068. LOAD DATA LOCAL INFILE file request rejected due to restrictions on access.
Grateful for any help and let me know if you want me to provide more detail.
Solution 1:[1]
Solved now. Allowed read access to all files in Xampp folder by choosing the setting "Use for included objects" (don't know exactly what it's called in English) on the Xampp parent folder.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Jimmy Morén |