Load data local infile

Discussion in 'MySQL' started by siddharth007, Nov 19, 2012.

  1. #1
    Hi everyone. I want to load the data in text file to a db table.The text file is located in a remote location(on a linux machine). I am using this command (inside a bash script on my local system)

    /usr/bin/mysql -u <username of local machine> -p<password of local machine> -e "LOAD DATA LOCAL INFILE '//10.X.XX.XX/fileX' INTO TABLE systime.boottime FIELDS TERMINATED BY ' ' LINES TERMINATED BY '\n';"

    where 10.X.X.XX is the IP address of the remote machine where the text file is stored (in the location /var/lib/mysql) .However the db table is located on the local machine and needs to be populated with the text data in the remote location.I have set the local-infile=1 on both local and remote machine as well as the file is stored in the mysql db directory(which i guess should be readable even remotely). I am getting this error

    ERROR 1148 (42000) at line 1: The used command is not allowed with this MySQL version


    Any ideas why???

    Do i need to provide grants on the remote system or what else??
     
    siddharth007, Nov 19, 2012 IP
  2. alxkls

    alxkls Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    1. Which version of mysql are you using?
    2. try simply "load data infile"

    A lot of things could play a role in that. Including firewall...
     
    alxkls, Nov 28, 2012 IP