We help IT Professionals succeed at work.
Get Started

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

2,410 Views
Last Modified: 2019-12-27
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'; 

Open in new window


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
Comment
Watch Question
This problem has been solved!
Unlock 1 Answer and 1 Comment.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE