Re: LOAD DATA LOCAL INFILE in Alpha 3.23.49]
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 [EMAIL PROTECTED] 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 http://us.i1.yimg.com/us.yimg.com/i/space.gif From: Thomas Birchmire [EMAIL PROTECTED] http://us.i1.yimg.com/us.yimg.com/i/space.gif To: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] http://us.i1.yimg.com/us.yimg.com/i/space.gif Subject: Re: LOAD DATA LOCAL INFILE in Alpha 3.23.49] http://us.i1.yimg.com/us.yimg.com/i/space.gif CC: [EMAIL PROTECTED] http://us.i1.yimg.com/us.yimg.com/i/space.gif 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 advertised. Regards Tom Birchmire Michael Widenius [EMAIL PROTECTED] wrote: Hi! Sinisa == Sinisa Milivojevic [EMAIL PROTECTED] writes: Sinisa [EMAIL PROTECTED] 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 [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php Attachment: Forwarded Message From: Sinisa Milivojevic [EMAIL PROTECTED] http://us.i1.yimg.com/us.yimg.com/i/space.gif Date: Tue, 5 Mar 2002 14:43:23 +0200 http://us.i1.yimg.com/us.yimg.com/i/space.gif To: [EMAIL PROTECTED] http://us.i1.yimg.com/us.yimg.com/i/space.gif CC: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] http://us.i1.yimg.com/us.yimg.com/i/space.gif Subject: Re: LOAD DATA LOCAL INFILE in Alpha 3.23.49] http://us.i1.yimg.com/us.yimg.com/i/space.gif 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 advertised. Regards Tom Birchmire loca-infile is not a variable. Therefore, you either start a server with --local-infile
Re: [Re: LOAD DATA LOCAL INFILE in Alpha 3.23.49]]
Hi! Thomas == Thomas Birchmire [EMAIL PROTECTED] writes: Thomas I tried putting --local-infile in my server script and local-infile in the Thomas /etc/my.cnf file. I also placed a number or logging cammands in the startup Thomas script hoping to catch lower level messages. There appears to be little Thomas effect on anything. Thomas Regards, Tom Birchmire Thomas -- script and log stuff Thomas Startup Script using --local-infile Thomas #! /bin/sh Thomas cd /usr/local/mysql/ Thomas ./bin/safe_mysqld --user=mysql --local-infile --warnings --log-long-format Thomas MYSQL Session with error mysql select * from pet - ; Thomas +--++-+--++---+ Thomas | name | owner | species | sex | birth | death | Thomas +--++-+--++---+ Thomas | Puffball | Diane | hamster | f| 1999-03-30 | NULL | Thomas | Fluffy | Harold | cat | f| 1993-02-04 | NULL | Thomas +--++-+--++---+ Thomas 2 rows in set (0.03 sec) mysql load data local infile /home/tomb01/data/pet.txt into table pet; Thomas ERROR 1148: The used command is not allowed with this MySQL version mysql quit You also have to start 'mysql' with --local-infile for this to work. 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 [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
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 advertised. 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 [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer /_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus ___/ www.mysql.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 [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: [Re: LOAD DATA LOCAL INFILE in Alpha 3.23.49]]
I tried putting --local-infile in my server script and local-infile in the /etc/my.cnf file. I also placed a number or logging cammands in the startup script hoping to catch lower level messages. There appears to be little effect on anything. Regards, Tom Birchmire -- script and log stuff Startup Script using --local-infile #! /bin/sh cd /usr/local/mysql/ ./bin/safe_mysqld --user=mysql --local-infile --warnings --log-long-format MYSQL Session with error mysql select * from pet - ; +--++-+--++---+ | name | owner | species | sex | birth | death | +--++-+--++---+ | Puffball | Diane | hamster | f| 1999-03-30 | NULL | | Fluffy | Harold | cat | f| 1993-02-04 | NULL | +--++-+--++---+ 2 rows in set (0.03 sec) mysql load data local infile /home/tomb01/data/pet.txt into table pet; ERROR 1148: The used command is not allowed with this MySQL version mysql quit Sinisa Milivojevic [EMAIL PROTECTED] wrote: 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 advertised. 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 -- - 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 [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: [Re: LOAD DATA LOCAL INFILE in Alpha 3.23.49]]
Thomas Birchmire writes: I tried putting --local-infile in my server script and local-infile in the /etc/my.cnf file. I also placed a number or logging cammands in the startup script hoping to catch lower level messages. There appears to be little effect on anything. Regards, Tom Birchmire As I said, a fix will appear in 3.23.50, but if you build from source, this is a patch that fixes a problem : --- 1.160/configure.in Wed Feb 13 21:53:22 2002 +++ 1.161/configure.in Tue Mar 5 15:46:28 2002 @@ -591,6 +591,8 @@ [ ENABLED_LOCAL_INFILE=no ] ) +AC_SUBST(ENABLE_LOCAL_INFILE) + # Use Paul Eggerts macros from GNU tar to check for large file support. MYSQL_SYS_LARGEFILE --- 1.65/libmysql/libmysql.cWed Feb 13 19:09:26 2002 +++ 1.66/libmysql/libmysql.cTue Mar 5 15:46:28 2002 @@ -1022,7 +1022,7 @@ /* Only enable LOAD DATA INFILE by default if configured with - --with-enabled-local-inflile + --enable-local-infile */ #ifdef ENABLED_LOCAL_INFILE mysql-options.client_flag|= CLIENT_LOCAL_FILES; -- Regards, __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Mr. Sinisa Milivojevic [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer /_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus ___/ www.mysql.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 [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: LOAD DATA LOCAL INFILE in Alpha 3.23.49
Hi! Sinisa == Sinisa Milivojevic [EMAIL PROTECTED] writes: Sinisa [EMAIL PROTECTED] 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 [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: LOAD DATA LOCAL INFILE in Alpha 3.23.49]
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 advertised. Regards Tom Birchmire Michael Widenius [EMAIL PROTECTED] wrote: Hi! Sinisa == Sinisa Milivojevic [EMAIL PROTECTED] writes: Sinisa [EMAIL PROTECTED] 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 [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - 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 [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: LOAD DATA LOCAL INFILE in Alpha 3.23.49
Rob Steele writes: Thanks. I don't think this feature is working as the documentation says it should. Section 4.2.4 of the manual says: By default all MySQL clients and libraries are compiled with | --enable-local-infile|, to be compatible with MySQL 3.23.48 and before. That seems to not be true, at least with the Aplha binary. Thanks, Rob thanks, we shall check it out !! -- Regards, __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Mr. Sinisa Milivojevic [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer /_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus ___/ www.mysql.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 [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php