SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Aug 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MYSQL data Import Error

    I am having error while using load data local infile on button when it is executed from my php program
    --here's the code

    sc_exec_sql("load data local infile '/PATH/IMPORT/FILE' into table TABLETOIMPORT fields terminated by '\t' lines terminated by '\n'")

    this script returns:

    Error while accessing the database:
    The used command is not allowed with this MySQL version

    but it works fine when i execute this same script on mysql on server command line (Ubuntu server)

    load data local infile '/PATH/IMPORT/FILE' into table TABLETOIMPORT fields terminated by '\t' lines terminated by '\n'

    How to solve this problem??

    Below are the details of my development environment
    Ubuntu Server 13.04
    PHP 5.49
    MySQL 14.14
    Rapid Development Tool - Scriptcase 7.1
    Load Data Local has been set to 1 (enabled)

    or any other way to import .dat file into MySQL.

    Thanks!

  2. #2
    SitePoint Evangelist
    Join Date
    Aug 2006
    Location
    Nantwich, Cheshire
    Posts
    409
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    What format is the incoming file, just tab-delimited ASCII? If so, you could write a loop to load it, parse it into records then insert each record into the table.

    I have no experience on why the command doesn't work.
    http://www.firenza.net - my homage to a car from the 1970s


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •