--local-infile: mysql cmd line args from Perl?

--local-infile: mysql cmd line args from Perl?

am 20.06.2002 20:02:34 von Tom Atwater

Hello,

I am having the problem detailed below.

The solution according to Monty is to
invoke mysql from the cmd line with the --local-infile option.

Anyone know how I can enable this if instead
connecting to the database through a Perl script?

I don't see anything in perldoc DBD::mysql about
passing cmd line arguments .

Note that I do start the mysqld daemon with this argument
already -- that doesn't help.

I also tried substituting "dbi:mysql --local-infile:"
for "dbi:mysql:" in the 1st arg to DBI->connect(),
but that didn't work.

Tom

--- Tom Atwater wrote:
> Date: Tue, 18 Jun 2002 14:39:15 -0700 (PDT)
> From: Tom Atwater
> Subject: Re: LOAD DATA LOCAL INFILE in Alpha 3.23.49]
> To: mysql@lists.mysql.com
>
>
> Hello,
>
> Below is a thread from March.
>
> Basically, I am having the same problem in
> v3.23.49 (release version, not Alpha).
> I also have Linux RedHat 7.2, same as Tom.
> I compiled MySQL from source using gcc v2.96 .
>
> Here are the details of my problem:
>
> The SQL command
>
> LOAD DATA LOCAL INFILE '/home/toma/spotplay/EVD0619.EG' REPLACE INTO TABLE
> `TSN` FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
>
> works fine from a phpMyAdmin web page;
> however, the exact same command inside a
> Perl script on the same machine localhost fails
> with the message
>
> DBD::mysql::st execute failed: The used command is not allowed with this
> MySQL version at /home/toma/lib/perl5/Database/MySql.pm line 61.
> Can't execute SQL statement:
> The used command is not allowed with this MySQL version
>
> I assume this discrepancy means that phpMyAdmin is
> using the server, while the Perl script is a client.
>
>
> I have tried all of the following
> -- using local-infile in my.cnf as Sinisa suggests
> -- rerunning./configure with arg --enable-local-infile, then recompiling
> -- restarting safe_mysqld with --local-infile=1
>
> I have also looked at the suggested fixes in
> "Security issues with LOAD DATA LOCAL" in the MySQL
> documentation at
> http://www.mysql.com/doc/L/O/LOAD_DATA_LOCAL.html
> which says among other things
> > By default, all MySQL clients and libraries are compiled
> > with --enable-local-infile, to be compatible with
> > MySQL 3.23.48 and before.
>
> If that is true, and I didn't change the default
> the first time I compiled it, then using --local-infile=1
> when starting safe_mysqld should enable LOAD DATA
> LOCAL INFILE, the way I read it.
> In any case after recompiling it should enable it.
>
> The web page also says
> > 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's a C function. Any way to call this from Perl?
>
> Michael Widenius wrote:
> > > Did you give the above option to both 'mysqld' and 'mysql' ?
>
> How do I do it for mysql from inside a Perl script?
> Can you pass args through Perl DBI calls to this end,
> does anyone know?
> Or am I missing something more obvious?
>
> Tom
>
>
>
>
> Date: Mon, 04 Mar 2002 15:27:58 -0500
>
> From: "Thomas Birchmire"
>
> To: monty@mysql.com, sinisa@mysql.com, rob@fatkat.com
>
> Subject: Re: LOAD DATA LOCAL INFILE in Alpha 3.23.49]
>
> CC: mysql@lists.mysql.com
>
>
> I have the same problem using Linux RedHat 7.2. Just what do I have to
> configure my binary MySQL : Ver 8.23 Distrib 3.23.49a, for pc-linux-gnu on
> i686?
> The rest of MySQL works as it should.
> Regards Tom Birchmire
>
>
> Michael Widenius wrote:
> > > Hi!
> > > >>>>> "Sinisa" == Sinisa Milivojevic writes:
> > > Sinisa> rob@fatkat.com writes:
> > >> >Description:
> > >> LOAD DATA LOCAL INFILE ...
> > >> > >> leads to 'The used command is not allowed with this MySQL version'
> > >> > >> This happens regardless of whether I have a
> > >> > >> local-infile = 1
> > >> > >> in my /etc/my.cnf. In neither case does the local-infile variable
> show
> > >> up with SHOW VARIABLES.
> > > We don't have a status variable that shows if this feature is enabled
> > or not.
> > > The above is quite strange as I did test this properly before doing a
> > release.
> > > Did you give the above option to both 'mysqld' and 'mysql' ?
> > > Which MySQL distribution are you using ?
> > > Sinisa> Hi!
> > > Sinisa> A new startup variable :
> > > Sinisa> --local-infile
> > > Sinisa> must be used to enable the above feature.
> > > That is what the user described that he did do...
> > > Regards,
> > Monty
> > > ------------------------------------------------------------ ---------
> > Before posting, please check:
> > http://www.mysql.com/manual.php (the manual)
> > http://lists.mysql.com/ (the list archive)
> > > To request this thread, e-mail
> > To unsubscribe, e-mail
>
> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> >
>
> Attachment: Forwarded Message
>
> From: "Sinisa Milivojevic"
>
> Date: Tue, 5 Mar 2002 14:43:23 +0200
>
> To: tbirchmire@usa.net
>
> CC: monty@mysql.com, rob@fatkat.com, mysql@lists.mysql.com
>
> Subject: Re: LOAD DATA LOCAL INFILE in Alpha 3.23.49]
>
>
> Thomas Birchmire writes:
> > I have the same problem using Linux RedHat 7.2. Just what do I have to
> > configure my binary MySQL : Ver 8.23 Distrib 3.23.49a, for pc-linux-gnu on
> > i686?
> > The rest of MySQL works as it should.
> > Regards Tom Birchmire
> > > loca-infile is not a variable.
>
> Therefore, you either start a server with --local-infile or have in
> your /etc/my.cnf :
>
> [mysqld]
> local-infile
>
> --
> Regards,
> __ ___ ___ ____ __
> / |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic
> / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer
> /_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus
> <___/ www.mysql.com
>
>
>
>
> =====
> Tom Atwater
> tomath2o.yahoo.com
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
> http://fifaworldcup.yahoo.com
>
> ------------------------------------------------------------ ---------
> Before posting, please check:
> http://www.mysql.com/manual.php (the manual)
> http://lists.mysql.com/ (the list archive)
>
> To request this thread, e-mail
> To unsubscribe, e-mail
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>



=====
Tom Atwater
tomath2o.yahoo.com

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1830@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re:

am 30.06.2005 19:22:59 von Patrick Galbraith

--Apple-Mail-54-111059222
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=ISO-8859-1;
delsp=yes;
format=flowed

Arunkumar,

Could you possibly try to build DBD::mysql without that flag using GCC? =20=

I think that could clear up your issue,

kind regards,

Patrick

On Jun 30, 2005, at 6:10 PM, wrote:

> Hi All,
>
> I am facing the build problem while installing the DBD-MySql perl =20
> module (ver 2.9008) using both GCC and CC compilers in HP-UX machine.
>
> For the Build using GCC, the compiler error is produced due to the =20
> unknown=A0compiler option "+DAportable".
>
> For the Build using CC, the preprocessor error is produced due to the =20=

> recursive declration of macro "PerlIO" in perlio.h file.
>
> Please give me the solution to get rid of this problem.
>
> Thanks in advance.
>
> Regards,
> Arun.
> =A0
> Wipro Technologies.
>
>
> The following is the log for both build.
>
> =
==================== =====3D=
==================== =====3D=
==================== =
> ===================3D
>   =A0 DBD-Mysql-2.9008 Perl module Build in HP-UX 11.11=A0 using =
GCC
> =
==================== =====3D=
==================== =====3D=
==================== =
> ===================3D
>
> # uname -a
> HP-UX hpccase B.11.11 U 9000/871 2015587066 unlimited-user license
>
> # perl -v
> This is perl, v5.8.7 built for PA-RISC2.0
>
> # gcc -v
> Using built-in specs.
> Target: hppa2.0w-hp-hpux11.11
> Configured with:
> /scratch/joseph/pkgbuild/3.3.1/hpux-11/gcc-4.0.0/configure
> --enable-languages=3Dc,c++ --enable-threads=3Dposix --disable-nls
>
> --disable-libmudflap --with-gnu-as --without-gnu-ld
> --with-as=3D/usr/local/bin/as --with-ld=3D/usr/ccs/bin/ld
> --prefix=3D/usr/local
> Thread model: posix
> gcc version 4.0.0
>
> # perl Makefile.PL CC=3Dgcc
> I will use the following settings for compiling and testing:
>
> =A0 cflags      =A0 (mysql_config) =3D
> -I/cmdisk1/mysql-max-4.1.12-hp-hpux11.11-hppa2.0w/include +DAportable
> =A0 libs        =A0 (mysql_config) =3D
> -L/cmdisk1/mysql-max-4.1.12-hp-hpux11.11-hppa2.0w/lib -lmysqlclient =
-lz
> -lcrypt -lnsl -lm
> =A0 mysql_config=A0 (guessed     ) =3D mysql_config
> =A0 nocatchstderr (default     ) =3D 0
> =A0 nofoundrows   (default     ) =3D 0
> =A0 ssl           (guessed     ) =3D 0
> =A0 testdb      =A0 (default     ) =3D test
> =A0 testhost    =A0 (default     ) =3D
> =A0 testpassword=A0 (default     ) =3D
> =A0 testsocket  =A0 (default     ) =3D
> =A0 testuser    =A0 (default     ) =3D
>
> To change these settings, see 'perl Makefile.PL --help' and
> 'perldoc INSTALL'.
>
> Note (probably harmless): No library found for -lz
> Using DBI 1.48 (for perl 5.008007 on PA-RISC2.0) installed in
> /opt/perl/lib/site_perl/5.8.7/PA-RISC2.0/auto/DBI/
> Writing Makefile for DBD::mysql
> # make
>       =A0 gcc -c=A0 =
-I/opt/perl/lib/site_perl/5.8.7/PA-RISC2.0/auto/DBI/
> -I/cmdisk1/mysql-max-4.1.12-hp-hpux11.11-hppa2.0w/includ
> e +DAportable -DDBD_MYSQL_INSERT_ID_IS_GOOD -g   -mpa-risc-2-0
> -D_HPUX_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/pro/l
> ocal/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=3D64 -g -O
> -DVERSION=3D\"2.9008\"=A0 -DXS_VERSION=3D\"2.9008\" -fPIC "-I/opt/
> perl/lib/5.8.7/PA-RISC2.0/CORE"   dbdimp.c
> gcc: +DAportable: No such file or directory
> *** Error exit code 1
>
> Stop.
>
> =
==================== =====3D=
==================== =====3D=
==================== =
> ===================3D
>
> =
==================== =====3D=
==================== =====3D=
==================== =
> ===================3D
>       =A0 DBD-Mysql-2.9008 Perl module Build in HP-UX =
11.11=A0 using HP C =20
> compiler (cc)
> =
==================== =====3D=
==================== =====3D=
==================== =
> ===================3D
>
>
> # perl Makefile.PL CC=3Dcc
> I will use the following settings for compiling and testing:
>
> =A0 cflags      =A0 (mysql_config) =3D
> -I/cmdisk1/mysql-max-4.1.12-hp-hpux11.11-hppa2.0w/include +DAportable
> =A0 libs        =A0 (mysql_config) =3D
> -L/cmdisk1/mysql-max-4.1.12-hp-hpux11.11-hppa2.0w/lib -lmysqlclient =
-lz
> -lcrypt -lnsl -lm
> =A0 mysql_config=A0 (guessed     ) =3D mysql_config
> =A0 nocatchstderr (default     ) =3D 0
> =A0 nofoundrows   (default     ) =3D 0
> =A0 ssl           (guessed     ) =3D 0
> =A0 testdb      =A0 (default     ) =3D test
> =A0 testhost    =A0 (default     ) =3D
> =A0 testpassword=A0 (default     ) =3D
> =A0 testsocket  =A0 (default     ) =3D
> =A0 testuser    =A0 (default     ) =3D
>
> To change these settings, see 'perl Makefile.PL --help' and
> 'perldoc INSTALL'.
>
> Checking if your kit is complete...
> Looks good
> Note (probably harmless): No library found for -lz
> Using DBI 1.48 (for perl 5.008007 on PA-RISC2.0) installed in
> /opt/perl/lib/site_perl/5.8.7/PA-RISC2.0/auto/DBI/
> Writing Makefile for DBD::mysql
> # make
> cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
> cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
> cp lib/Mysql.pm blib/lib/Mysql.pm
> cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
> cp lib/Mysql/Statement.pm blib/lib/Mysql/Statement.pm
> cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
>       =A0 cc -c=A0 =
-I/opt/perl/lib/site_perl/5.8.7/PA-RISC2.0/auto/DBI/
> -I/cmdisk1/mysql-max-4.1.12-hp-hpux11.11-hppa2.0w/include +DAportable
>
> -DDBD_MYSQL_INSERT_ID_IS_GOOD -g   -mpa-risc-2-0 -D_HPUX_SOURCE
> -DDEBUGGING -fno-strict-aliasing -pipe -I/pro/local/include
>
> -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=3D64 -g -O
> -DVERSION=3D\"2.9008\"=A0 -DXS_VERSION=3D\"2.9008\" -fPIC
>
> "-I/opt/perl/lib/5.8.7/PA-RISC2.0/CORE"   dbdimp.c
> (Bundled) cc: warning 480: The -g option is available only with the =20=

> C/ANSI C product; ignored.
> (Bundled) cc: warning 422: Unknown option "m" ignored.
> (Bundled) cc: warning 480: The -p option is available only with the =20=

> C/ANSI C product; ignored.
> (Bundled) cc: warning 422: Unknown option "a" ignored.
> (Bundled) cc: warning 422: Unknown option "-" ignored.
> (Bundled) cc: warning 480: The -r option is available only with the =20=

> C/ANSI C product; ignored.
> (Bundled) cc: warning 422: Unknown option "i" ignored.
> (Bundled) cc: warning 422: Unknown option "-" ignored.
> (Bundled) cc: warning 422: Unknown option "2" ignored.
> (Bundled) cc: warning 422: Unknown option "-" ignored.
> (Bundled) cc: warning 422: Unknown option "0" ignored.
> (Bundled) cc: warning 422: Unknown option "f" ignored.
> (Bundled) cc: warning 480: The -p option is available only with the =20=

> C/ANSI C product; ignored.
> (Bundled) cc: warning 422: Unknown option "i" ignored.
> (Bundled) cc: warning 480: The -p option is available only with the =20=

> C/ANSI C product; ignored.
> (Bundled) cc: warning 480: The -e option is available only with the =20=

> C/ANSI C product; ignored.
> (Bundled) cc: warning 480: The -g option is available only with the =20=

> C/ANSI C product; ignored.
> (Bundled) cc: warning 480: The -O option is available only with the =20=

> C/ANSI C product; ignored.
> (Bundled) cc: warning 422: Unknown option "f" ignored.
> cpp: "/opt/perl/lib/5.8.7/PA-RISC2.0/CORE/perlio.h", line 114: error =20=

> 4065: Recursion in macro "PerlIO".
> *** Error exit code 1
>
> Stop.
> #
>
> =
==================== =====3D=
==================== =====3D=
==================== =
> ===================3D
> =A0
>
>
> Confidentiality Notice
>
> The information contained in this electronic message and any =20
> attachments to this message are intended
> for the exclusive use of the addressee(s) and may contain =20
> confidential or privileged information. If
> you are not the intended recipient, please notify the sender at Wipro =
=20
> or Mailadmin@wipro.com immediately
> and destroy all copies of this message and any attachments.
>
Patrick Galbraith Senior Software Developer
patg@mysql.com http://www.mysql.com

Those who fear climbing mountains
Shall live forever in the holes - Arab Poet

--Apple-Mail-54-111059222--