troubleshooting Question

#2000 - LOAD DATA LOCAL INFILE is forbidden, check mysqli.allow_local_infile error when loading data into tables in XAMPP

Avatar of James Froggatt
James FroggattFlag for France asked on
DatabasesSQL
1 Comment1 Solution2515 ViewsLast Modified:
Hello,

I am using XAMPP (v3.2.4) on my Win10 computer to develop a website with. I have recently purchased a world database of places and the instructions to set up the database (load the data into tables that I've created) tell me to use the SQL

LOAD DATA LOCAL INFILE '/xampp/mysql/country.dat' INTO TABLE country CHARACTER SET UTF8 fields terminated by '\t' LINES TERMINATED BY '\r\n'; 
LOAD DATA LOCAL INFILE '/xampp/mysql/states.dat' INTO TABLE states CHARACTER SET UTF8 fields terminated by '\t' LINES TERMINATED BY '\r\n';
LOAD DATA LOCAL INFILE '/xampp/mysql/city.dat' INTO TABLE city CHARACTER SET UTF8 fields terminated by '\t' LINES TERMINATED BY '\r\n'; 
LOAD DATA LOCAL INFILE '/xampp/mysql/timezone.dat' INTO TABLE timezone CHARACTER SET UTF8 fields terminated by '\t' LINES TERMINATED BY '\r\n'; 

Within phpMyAdmin when I run the SQL above, I keep getting the error:

#2000 - LOAD DATA LOCAL INFILE is forbidden, check mysqli.allow_local_infile


I have researched online and have changed, in the php.ini file

;mysqli.allow_local_infile

to

mysqli.allow_local_infile=On

After restart of Mysql and Apache in XAMPP, I am still getting the error


#2000 - LOAD DATA LOCAL INFILE is forbidden, check mysqli.allow_local_infile


I have also read something about adding details to my.cnf file, but I have't done anything with that as I can't even find the file, I'm not sure it exists.

Please help,

Thank you
James
ASKER CERTIFIED SOLUTION
James Froggatt

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros