Forum Moderators: open

Message Too Old, No Replies

Bulk Insert in MySQL

LOAD DATA INFILE not working on remote server

         

IndiaMaster

5:09 am on May 23, 2007 (gmt 0)

10+ Year Member



Hi WebMasters,

I have got a typical problem in inserting Bulk Data from a .csv or .txt file into MySQL.

The code I wrote is:

$sql="LOAD DATA INFILE '".$filepath."' INTO TABLE att_temp FIELDS TERMINATED BY '\t' ENCLOSED BY '\"' LINES TERMINATED BY '\n'";
mysql_query($sql);

Its working fine in my local system. But when I run this code on the remote server it fails. I have got all the administrative permission on the DB.

Can anyone help?

Thanks in advance

phranque

7:24 am on May 23, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



have you checked that the correct record terminators are intact for the remote server version of the file?

IndiaMaster

3:43 am on Jun 1, 2007 (gmt 0)

10+ Year Member



Finally the issue has been solved. I need the GRANT ALL permission to execute that command. In my earlier post I stated I got all the permissions but I think there were something that I missed.

coopster

3:36 am on Jun 14, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I'm not so certain you needed to GRANT ALL, you may have only needed to add the FILE privilege type.

[dev.mysql.com...]

Don't forget to FLUSH PRIVILEGES after making permission updates.