Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 12933 - Enable LOCAL DATA in mysql-server
Summary: Enable LOCAL DATA in mysql-server
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Release Media
Classification: Unclassified
Component: Everything (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Donny Davies (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-30 04:24 UTC by Jesus Gonzalez Alvarez
Modified: 2005-10-31 07:19 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesus Gonzalez Alvarez 2002-12-30 04:24:25 UTC
It's needed if you want to execute some SQL sentences from a file in a remote
machine (not in the server machine).

To do that, we can define an USE flag (for example mysqllocalinfile) and modify
the ebuild (in the src_compile section) adding:

use mysqllocalinfile && myconf="${myconf} --enable-local-infile"

or unconditionally adding (after econf \)

--enable-local-infile \

In order to choose the way to do that you must take into account the following
issue (from MySQL Manual):

"4.2.4 Security issues with LOAD DATA LOCAL

In MySQL 3.23.49 and MySQL 4.0.2, we added some new options to deal with
possible security issues when it comes to LOAD DATA LOCAL.

There are two possible problems with supporting this command:

As the reading of the file is initiated from the server, one could theoretically
create a patched MySQL server that could read any file on the client machine
that the current user has read access to, when the client issues a query against
the table.

In a web environment where the clients are connecting from a web server, a user
could use LOAD DATA LOCAL to read any files that the web server process has read
access to (assuming a user could run any command against the SQL server).

There are two separate fixes for this:

If you don't configure MySQL with --enable-local-infile, then LOAD DATA LOCAL
will be disabled by all clients, unless one calls mysql_options(...
MYSQL_OPT_LOCAL_INFILE, 0) in the client. See section 8.4.3.159 mysql_options().

For the mysql command-line client, LOAD DATA LOCAL can be enabled by specifying
the option --local-infile[=1], or disabled with --local-infile=0.

By default, all MySQL clients and libraries are compiled with
--enable-local-infile, to be compatible with MySQL 3.23.48 and before.

One can disable all LOAD DATA LOCAL commands in the MySQL server by starting
mysqld with --local-infile=0.

In the case that LOAD DATA LOCAL INFILE is disabled in the server or the client,
you will get the error message (1148):

The used command is not allowed with this MySQL version
"
Comment 1 Donny Davies (RETIRED) gentoo-dev 2003-01-04 17:03:31 UTC
I read over this again, and this is what I see:

By default, all MySQL clients and libraries are compiled with
--enable-local-infile, to be compatible with MySQL 3.23.48 and before.

so ... its already enabled then.. what is there for me to change?
Comment 2 Jesus Gonzalez Alvarez 2003-01-05 04:11:01 UTC
Yes, that's true. But this option is enabled in the clients, not in the server.
When I try to execute an "LOAD DATA LOCAL INFILE" in mysql console or in a PHP
script it doesn't work unless you compile mysql-server with
"--enable-local-infile" option.

"If you don't configure MySQL with --enable-local-infile, then LOAD DATA LOCAL
will be disabled by all clients, unless one calls mysql_options(...
MYSQL_OPT_LOCAL_INFILE, 0) in the client. See section 8.4.3.159 mysql_options()."

That means that only mysql clients which uses mysql_options(..) (it's a C
function) could do LOAD DATA LOCAL. The clients I'm using (I think that are the
most used) perhaps doesn
Comment 3 Jesus Gonzalez Alvarez 2003-01-05 04:11:01 UTC
Yes, that's true. But this option is enabled in the clients, not in the server.
When I try to execute an "LOAD DATA LOCAL INFILE" in mysql console or in a PHP
script it doesn't work unless you compile mysql-server with
"--enable-local-infile" option.

"If you don't configure MySQL with --enable-local-infile, then LOAD DATA LOCAL
will be disabled by all clients, unless one calls mysql_options(...
MYSQL_OPT_LOCAL_INFILE, 0) in the client. See section 8.4.3.159 mysql_options()."

That means that only mysql clients which uses mysql_options(..) (it's a C
function) could do LOAD DATA LOCAL. The clients I'm using (I think that are the
most used) perhaps doesn´t call this function so I've never could do LOAD DATA
LOCAL unless mysql-server is compiled properly.
Comment 4 Donny Davies (RETIRED) gentoo-dev 2003-02-09 00:48:48 UTC
i thought i already closed this.
bugs in the bugtracker.
Comment 5 Chris Gianelloni (RETIRED) gentoo-dev 2005-10-31 07:19:03 UTC
I apologise for this bugspam, but I wish to close this product, so I need to
move all the bugs.