Submit Your Article Forum Rules

Results 1 to 4 of 4

Thread: Not able to LOAD DATA LOCAL INFILE anymore

  1. #1
    Senior Member
    Join Date
    Aug 2006
    Posts
    274

    Not able to LOAD DATA LOCAL INFILE anymore

    Hi all...

    My web host recently upgraded the PHP Admin system to 2.40 and mySQL to 4.0.27. And now, I am no longer able to import CSV data files into the database. The error I get is:
    --------------------------------------------------------------------------------------------------------------------------
    SQL-query :

    LOAD DATA LOCAL INFILE '/home/vdeck/tmp/phpVHHq7g' INTO TABLE `Inventory` FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\r\n'

    MySQL said:

    The used command is not allowed with this MySQL version
    --------------------------------------------------------------------------------------------------------------------------

    What gives? Why would mySQL remove this feature? Anyone know how to get around this?

    Very annoying...I need to import roughly 2000 records daily to run an inventory update on my site. I end up having to write scripts to write SQL Insert statements...

    By the way, anyone know how to import tab-delimited text files into the same?

    Thanks.

  2. #2
    WebProWorld MVP wige's Avatar
    Join Date
    Jun 2006
    Posts
    3,138

    Re: Not able to LOAD DATA LOCAL INFILE anymore

    LOAD DATA LOCAL INFILE is a security risk. As of MySQL 4.0.2, admins and hosting companies have the option, during the install process, to disable the LOCAL operator, since use of the operator with systems such as PHP MyAdmin represents a massive security threat (has to do with the way Linux handles permissions - any file visible to the Apache server application could be read by using this command and as a result source code and password files could be revealed to unauthorized users).
    The best way to learn anything, is to question everything.
    WigeDev - Freelance web and software development

  3. #3
    Senior Member
    Join Date
    Aug 2006
    Posts
    274

    Re: Not able to LOAD DATA LOCAL INFILE anymore

    wige:

    I rely on my supplier giving me an inventory file nightly which I read into excel and save as a CSV. Now since LOAD DATA has been turned off, I have had to convert the data into a sql "insert" scripts. Luckily, it is a file with not many columns. The updated master file, on the other hand has much more data.

    Do you have any suggestions I can try to minimize data-conversion time?

    thanks!

  4. #4
    WebProWorld MVP DaveSawers's Avatar
    Join Date
    Dec 2006
    Location
    Lunenburg, Nova Scotia, Canada
    Posts
    760

    Re: Not able to LOAD DATA LOCAL INFILE anymore

    Write a little Excel macro to reformat the data into inserts.
    Dynamic Software Development
    www.activeminds.ca

Similar Threads

  1. HomePages: Real Estate Listings, Local Data, and Aerial Ima
    By WPW_Feedbot in forum Search Engine Optimization Forum
    Replies: 0
    Last Post: 10-19-2005, 10:00 PM
  2. Local Matters Goes After Local Search Tech Market
    By WPW_Feedbot in forum Search Engine Optimization Forum
    Replies: 0
    Last Post: 09-30-2005, 03:00 PM
  3. Save Yahoo Local Data in Spreadsheet Format
    By WPW_Feedbot in forum Search Engine Optimization Forum
    Replies: 0
    Last Post: 03-29-2005, 11:30 PM
  4. Google Local Finally Adds Ability To List Your Local Busine
    By WPW_Feedbot in forum Marketing Strategies Discussion Forum
    Replies: 0
    Last Post: 03-15-2005, 03:00 PM

Posting Permissions

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