473,597 Members | 2,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Differences between DATA INFILE and LOAD DATA LOCAL INFILE ?

What are the differences between LOAD DATA INFILE and LOAD DATA LOCAL INFILE
?

I found some web hosting company do not allow using LOAD DATA INFILE but
allow LOAD DATA LOCAL INFILE. The reason is for the sake of security. What
does that mean ?
Jul 23 '05 #1
1 16056
Ray in HK wrote:
What are the differences between LOAD DATA INFILE and LOAD DATA LOCAL INFILE?
LOAD DATA LOCAL INFILE reads a file that is on the machine where you are
running the mysql client. For example, your PC. The file must be sent
over the network to the MySQL server host.

LOAD DATA INFILE reads a file that is already on the machine running the
mysql server. For example, the server at your web hosting company.

This is described on this web page:
http://dev.mysql.com/doc/mysql/en/load-data.html
I found some web hosting company do not allow using LOAD DATA INFILE but
allow LOAD DATA LOCAL INFILE. The reason is for the sake of security. What
does that mean ?


There's no way in MySQL to limit _which_ files can be read with LOAD
DATA INFILE; all files that are readable by the user id of the mysqld
process on the server would be readable.

You could use this command to read many file on the system that you
wouldn't have access to read as a customer of a web hosting service, and
then import the text from that file into a MySQL table.

Then you'd write a simple CGI script to display the text stored in the
MySQL database, thus allowing yourself (or the whole internet) to read
system files or other information that the web hosting company doesn't
want to be public.

So it makes sense that a web hosting company would want to restrict
access to LOAD DATA INFILE. However, I'm not sure how they're
accomlishing this while permitting LOAD DATA LOCAL INFILE; there is only
one GRANT privilege called "FILE" which permits or denies use of LOAD
DATA INFILE and SELECT... INTO OUTFILE. There is nothing mentioned in
the MySQL page http://dev.mysql.com/doc/mysql/en/grant.html to permit
LOAD DATA LOCAL INFILE while denying LOAD DATA INFILE.

Regards,
Bill K.
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2797
by: Andreas Emmert | last post by:
Dear NG, I'm using a PHP script for updating my database which relies on the "LOAD DATA LOCAL INFILE" command. As my provider recently updated the MySQL-database, he changed the "local-infile" setting to zero, i.e. my update-script doesn't work anymore (=> "The used command is not allowed with this MySQL version"). Is there a work-around to fix this problem? I though about the mysql_options command, but to frankly speaking, I have no...
14
9736
by: Bruce A. Julseth | last post by:
When I execute this SQL statement in my PHP code, I get an error "File '.\Address.txt' not found (Errcode: 2)" $File = addslashes(".\Address.txt"); $SQL = "Load Data InFile \"" . $File . "\" into table addresses"; $result = mysql_query($SQL) or die(mysql_error()); The file is located in the same directory as my .PHP file. How do I generate a relative address for this file so that it can be found?
0
6677
by: Donald Tyler | last post by:
Then the only way you can do it that I can think of is to write a PHP script to do basically what PHPMyAdmin is trying to do but without the LOCAL in there. However to do that you would need to be able to place the PHP file on the server, and I guess you probably can't do that either. Talk about catch 22... The only other way I can think of is to install MySQL on a machine you control, then import the data there using the method I...
1
4060
by: Jami Bradley | last post by:
HI all, For the past several months we have been using LOAD DATA LOCAL INFILE to bulk load tables within Perl modules. Recently, someone thought it would be a good idea to upgrade the Solaris machines - I'm thinking it wasn't that good an idea :-( We are now running MySQL 4.0.18 and the DBI version is 1.35. Now, our scripts are failing with the dreaded "The used command is not allowed with this MySQL version" message. Here's what I...
0
1852
by: Rajesh Kapur | last post by:
Hello, I am running MySQL 4.0.16. I get the error 'The used command is not allowed with this MySQL version' when using the 'load data local infile' command. The local_infile is ON; the select * into outfile works but load data local infile does not. What am I doing wrong? Thanks! DETAILS --->
0
1643
by: Steffen | last post by:
Hello, I´m using mysql 3.23.58 and I want to enable the local-infile option. The manual on dev.mysql.com says the following to that: ..... If you use LOAD DATA LOCAL in Perl scripts or other programs that read the group from option files, you can add the local-infile=1 option to that group. However, to keep this from causing problems for programs that do not understand local-infile, specify it using the
3
2742
by: nsh | last post by:
mailing.database.mysql, comp.lang.php subject: does "LOAD DATA" EVER work?!? I've tried EVERYTHING! version info: my isp is running my web page on a linux box with php ver. 4.4.1 according to phpinfo, the "mysql api client is ver. 4.0.25" - I have no idea how this relates, if at all, to the mysql engine's version. background:
0
321
by: drec | last post by:
I have a table in which its primary key is auto-incremented. Yet, when I try to load data using load data infile, this column will not auto-increment. I am leaving that column blank in my file to be uploaded, yet it fills this value in with a zero for all records. Should I be using a php script to load this file? Why isnt this updating correctly?
1
3424
by: Freedolen | last post by:
Hi, I have checked with some sample data and found inserting of data using 'insert command' takes more time than using 'load data' command to load data from another file. What is the process difference between these two commands. I have another question, when i insert data using load data command from external file is there anyway to get how much rows inserted at the time of loading the data. Regards, Freedolen
0
7959
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7883
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8021
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6677
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5842
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3876
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3917
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1492
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.