Click here to get back home

Differences between DATA INFILE and LOAD DATA LOCAL INFILE ?

 HomeNewsGroups | Search | About
 mailing.database.mysql    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Differences between DATA INFILE and LOAD DATA LOCAL INFILE ? Ray in HK 06-26-2005
Get Chitika Premium
Posted by Ray in HK on June 26, 2005, 6:21 pm
Please log in for more thread options
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 ?




Posted by Bill Karwin on June 26, 2005, 2:42 pm
Please log in for more thread options
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.


Posted by Ray in HK on June 27, 2005, 10:56 am
Please log in for more thread options
Thank you so much , very detail explaination.

¼¶¼g...
> 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.




Similar ThreadsPosted
Complex LOAD DATA INFILE May 18, 2006, 4:45 am
How to specify Date format during LOAD DATA INFILE ? June 27, 2005, 6:52 pm
LOAD DATA INFILE Syntax Error September 26, 2005, 6:16 pm
Load Data Infile - edit a field January 17, 2006, 9:35 pm
does "LOAD DATA" EVER work?!? I've tried EVERYTHING! November 22, 2005, 9:43 am
Load Data - Succuess/Error information November 9, 2005, 9:46 am
MySQL with utf-8 charset - problem with 'LOAD DATA' February 28, 2006, 2:49 pm
I want to make transfer data between MySQL Server to MySQL Local . February 9, 2006, 1:25 am
storing data July 13, 2005, 8:26 pm
Compression of data September 21, 2005, 3:13 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap