Just found the below details here - http://dev.mysql.com/doc/refman/5.0/en/load-data-local.html
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@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.
- I'll get one file in the drupal's files directory, based on that file I have to update my tables.
- 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.
- 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).
- Now the problem occurs,
- 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:
- 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- 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@gmail.com Skype : vyasamit2004
Mobile : +91 993-040-1490 Phone : +91-022 428-884-07
Sumeet Pareek