Thanks for all the replies and support.<div><br></div><div>I have found the solution:</div><div>Here are the steps I followed:</div><div><ol><li>Removed Load Data from the .module file.</li><li>Since drupal is not supporting mysql_connect from the module file, I have created a new .php file in which I have called "mysql_connect" with the "client_flag" parameter passed as 128. More details
<a href="http://php.net/manual/en/function.mysql-connect.php">http://php.net/manual/en/function.mysql-connect.php</a></li><li>Now when my cron runs I'm doing my usual stuff, and then after that calling my .php script at the end.</li>
<li>in .php file I have mysql_connect which will connect to my database server and run LOAD DATA query and then come back to my module file to do other stuff.</li></ol><div>I know this is not a 100% or full proof solution BUT right now in situation like mine, I can't afford to spend more time on this so it is as it is.</div>
</div><div><br></div><div>Let me know if one of you can find any other soulution. BTW. this is working.</div><div><br></div><div>Thanks!!</div><div><br><div class="gmail_quote">On Sat, Nov 19, 2011 at 6:58 PM, sumeet pareek <span dir="ltr"><<a href="mailto:positivecharge@gmail.com">positivecharge@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Just found the below details here - <a href="http://dev.mysql.com/doc/refman/5.0/en/load-data-local.html" target="_blank">http://dev.mysql.com/doc/refman/5.0/en/load-data-local.html</a> <div>
I think this might help.. <br><br></div><div>>></div>
<div><span style="color:rgb(85,85,85);font-family:verdana,arial,helvetica,sans-serif;font-size:12px;line-height:21px;background-color:rgb(255,255,255)">Let me elaborate what took forever to find out..(*NIX)<br>
<br>1=ON; 0=OFF; LOCAL != PHP;<br><br>LOAD DATA INFILE '/full_path_to_file/your_file.txt' INTO TABLE your_table<br><br>You MUST have a compiled MySQL with '--enable-local-infile '<br><br>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. <br>
<br>--with-mysql=/usr/local/mysql (assuming your MySQL is located here)<br><br>You MUST start the MySQL daemon with the option '--local-infile=1'</span></div><div><span style="color:rgb(85,85,85);font-family:verdana,arial,helvetica,sans-serif;font-size:12px;line-height:21px;background-color:rgb(255,255,255)"><<</span></div>
<div><div><div class="h5"><br><div class="gmail_quote">On Sat, Nov 19, 2011 at 6:55 PM, sumeet pareek <span dir="ltr"><<a href="mailto:positivecharge@gmail.com" target="_blank">positivecharge@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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.<div>
<br></div><div>Do post your solution when you find one.<div><div><br><br><div class="gmail_quote">On Sat, Nov 19, 2011 at 6:41 PM, Amit Vyas <span dir="ltr"><<a href="mailto:vyasamit2007@gmail.com" target="_blank">vyasamit2007@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Druplers,<div><br></div><div>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:</div>
<div><br></div><div>I have to go live and I have two servers on Joyent. one is for database and another is for durpal installation with files.</div>
<div><ol><li>I'll get one file in the drupal's files directory, based on that file I have to update my tables.</li><li>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.</li>
<li>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).</li><li>Now the problem occurs, </li>
<li>
When I run the cron, its giving me the error "
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">user warning: The used command is not allowed with this MySQL version query: LOAD DATA LOCAL INFILE '/file/path</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">/file</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">.csv' IGNORE INTO table temp_table FIELDS TERMINATED BY ',' IGNORE 1 LINES</span> "</li>
</ol><div>We have tried these solutions:</div><div><ol><li>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</li>
<ul><ul><li><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> </span><span dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">[client]<br>
port = 3306<br>socket = /tmp/mysql.sock<br>local-infile =1</span></li></ul><ul><li><font color="#222222" face="arial, sans-serif"><span style="font-size:13px;background-color:rgb(255,255,255)">[mysqld]</span><br style="font-size:13px;background-color:rgb(255,255,255)">
<span style="font-size:13px;background-color:rgb(255,255,255)">port = 3306</span><br style="font-size:13px;background-color:rgb(255,255,255)"><span style="font-size:13px;background-color:rgb(255,255,255)">bind-address = 127.0.0.1</span><br style="font-size:13px;background-color:rgb(255,255,255)">
<span style="font-size:13px;background-color:rgb(255,255,255)">#bind-address = 10.12.24.151</span><br style="font-size:13px;background-color:rgb(255,255,255)"><span style="font-size:13px;background-color:rgb(255,255,255)">socket = /tmp/mysql.sock</span><br style="font-size:13px;background-color:rgb(255,255,255)">
<span style="font-size:13px;background-color:rgb(255,255,255)">skip-external-l</span><span style="font-size:13px;background-color:rgb(255,255,255)">ocking</span><br style="font-size:13px;background-color:rgb(255,255,255)">
<span style="font-size:13px;background-color:rgb(255,255,255)">#skip-bdb</span><br style="font-size:13px;background-color:rgb(255,255,255)"><span style="font-size:13px;background-color:rgb(255,255,255)">local-infile = 1</span>
</font></li></ul></ul><li>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.</li></ol></div><div>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?</div>
<div><br></div><div>Thanks!</div><span><font color="#888888"><div><br></div>-- <br><font size="2"><span style="font-family:tahoma,sans-serif">Cheers,</span><br style="font-family:tahoma,sans-serif"><span style="font-family:tahoma,sans-serif">Amit Vyas</span></font><br style="font-family:tahoma,sans-serif">
<span style="font-family:tahoma,sans-serif;color:rgb(102,102,102)">____________________________________</span><span style="font-family:tahoma,sans-serif;color:rgb(102,102,102)">____________________________</span><span style="font-family:tahoma,sans-serif;color:rgb(102,102,102)">____________</span><span style="font-family:tahoma,sans-serif;color:rgb(102,102,102)">____</span><br style="font-family:tahoma,sans-serif">
<span style="font-family:tahoma,sans-serif;color:rgb(51,51,51)">Email : </span><a style="font-family:tahoma,sans-serif;color:rgb(51,51,51)" href="mailto:vyasamit2007@gmail.com" target="_blank">vyasamit2007@gmail.com</a><span style="font-family:tahoma,sans-serif;color:rgb(51,51,51)"> Skype : vyasamit2004</span><br style="font-family:tahoma,sans-serif;color:rgb(51,51,51)">
<span style="font-family:tahoma,sans-serif;color:rgb(51,51,51)">Mobile : <a href="tel:%2B91%20993-040-1490" value="+919930401490" target="_blank">+91 993-040-1490</a> Phone : <a href="tel:%2B91-022%20428-884-07" value="+912242888407" target="_blank">+91-022 428-884-07</a> </span><br>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span><font color="#888888">-- <br><div>Sumeet Pareek</div><br>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div>Sumeet Pareek</div><br>
</font></span></div>
<br>--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><font size="2"><span style="font-family:tahoma,sans-serif">Cheers,</span><br style="font-family:tahoma,sans-serif">
<span style="font-family:tahoma,sans-serif">Amit Vyas</span></font><br style="font-family:tahoma,sans-serif"><span style="font-family:tahoma,sans-serif;color:rgb(102, 102, 102)">____________________________________</span><span style="font-family:tahoma,sans-serif;color:rgb(102, 102, 102)">____________________________</span><span style="font-family:tahoma,sans-serif;color:rgb(102, 102, 102)">____________</span><span style="font-family:tahoma,sans-serif;color:rgb(102, 102, 102)">____</span><br style="font-family:tahoma,sans-serif">
<span style="font-family:tahoma,sans-serif;color:rgb(51, 51, 51)">Email : </span><a style="font-family:tahoma,sans-serif;color:rgb(51, 51, 51)" href="mailto:vyasamit2007@gmail.com" target="_blank">vyasamit2007@gmail.com</a><span style="font-family:tahoma,sans-serif;color:rgb(51, 51, 51)"> Skype : vyasamit2004</span><br style="font-family:tahoma,sans-serif;color:rgb(51, 51, 51)">
<span style="font-family:tahoma,sans-serif;color:rgb(51, 51, 51)">Mobile : +91 993-040-1490 Phone : +91-022 428-884-07 </span><br>
</div>