[development] The used command is not allowed with this mysql version query

sumeet pareek positivecharge at gmail.com
Sat Nov 19 13:28:40 UTC 2011


Just found the below details here -
http://dev.mysql.com/doc/refman/5.0/en/load-data-local.html
I think this might help..

>>
Let me elaborate what took forever to find out..(*NIX)

1=ON; 0=OFF; LOCAL != PHP;

LOAD DATA INFILE '/full_path_to_file/your_file.txt' INTO TABLE your_table

You MUST have a compiled MySQL with '--enable-local-infile '

You MUST have compiled PHP using the full path to MySQL, otherwise it will
use it's internal handlers, which don't work with the "new" LOAD DATA.

--with-mysql=/usr/local/mysql (assuming your MySQL is located here)

You MUST start the MySQL daemon with the option '--local-infile=1'
<<

On Sat, Nov 19, 2011 at 6:55 PM, sumeet pareek <positivecharge at gmail.com>wrote:

> Hmm. I have not tried LOAD DATA query for myself ever, but have some
> general advice. How about trying the query from a php file after connecting
> to your db using mysql_db_connect(). If it does not work even then, perhaps
> you could ask the question on a mysql forum for more help. If it does, then
> it would be drupal specific problem and perhaps somebody here will be able
> to help.
>
> Do post your solution when you find one.
>
>
> On Sat, Nov 19, 2011 at 6:41 PM, Amit Vyas <vyasamit2007 at gmail.com> wrote:
>
>> Hello Druplers,
>>
>> Have been in this problem from last 3 days and did a lot of google but
>> didn't able to find any solution which work for me. Here is the problem:
>>
>> I have to go live and I have two servers on Joyent. one is for database
>> and another is for durpal installation with files.
>>
>>    1. I'll get one file in the drupal's files directory, based on that
>>    file I have to update my tables.
>>    2. I have written a module which will get that file and using LOAD
>>    DATA LOCAL INFILE, it will load all the data from csv file to a temp table.
>>    3. And this will be done when cron will run. It will execute the code
>>    and move the file to some other folder and load all the data and update the
>>    database(which is on other server).
>>    4. Now the problem occurs,
>>    5. When I run the cron, its giving me the error " user warning: The
>>    used command is not allowed with this MySQL version query: LOAD DATA LOCAL
>>    INFILE '/file/path/file.csv' IGNORE INTO table temp_table FIELDS
>>    TERMINATED BY ',' IGNORE 1 LINES "
>>
>> We have tried these solutions:
>>
>>    1. We have added "LOCAL INFILE=1" in my.cnf in "client" and "mysql"
>>    on both server [Which didn't work]: here is what we have done in my.cnf
>>       -  [client]
>>          port = 3306
>>          socket = /tmp/mysql.sock
>>          local-infile =1
>>       - [mysqld]
>>          port = 3306
>>          bind-address = 127.0.0.1
>>          #bind-address = 10.12.24.151
>>          socket = /tmp/mysql.sock
>>          skip-external-locking
>>          #skip-bdb
>>          local-infile = 1
>>       2. When we connect from fileserver to database server with command
>>    line and execute the same sql query then it is working fine BUT not with
>>    drupal module.
>>
>> We are now just frustrated with this error because we are solving this
>> from last 3 days and management is on us :) Can anyone has experience with
>> this type of problem before?
>>
>> Thanks!
>>
>> --
>> Cheers,
>> Amit Vyas
>> ________________________________________________________________
>> ________________
>> Email  : vyasamit2007 at gmail.com               Skype : vyasamit2004
>> Mobile : +91 993-040-1490                          Phone : +91-022
>> 428-884-07
>>
>
>
>
> --
> Sumeet Pareek
>
>


-- 
Sumeet Pareek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20111119/5c8e9da2/attachment-0001.html 


More information about the development mailing list