SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2003
    Location
    Lincoln NE
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Load Data Local Infile

    I'm trying to import some data from a .txt file. my database is set up and ready for use but when I type in the command LOAD DATA LOCAL INFILE 'C:/mysql/sampdb/member.txt' INTO TABLE sampdb.member to import the data to my table, I get the following error.
    The used command is not allowed with this MySQL version.
    the MySQL version I'm using is 4.0.12-nt

    Any Help is appericated. Thanks!

  2. #2
    SitePoint Zealot
    Join Date
    Mar 2002
    Location
    Vancouver, USA
    Posts
    143
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is this on your own server/computer that you have access to? I know some hosts have disable that feature because there's some sort of exploit that can be done with it. I'm not 100% sure if it will require a re-compile of MySQL or if it's an INI setting. I assume you did a search on MySQL.com?

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2003
    Location
    Lincoln NE
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up Resolved

    I got this matter resolved. All I did is removed the 'LOCAL' from the command.

    Thanks for the help.
    Last edited by chafikb; May 24, 2003 at 09:30.

  4. #4
    SitePoint Zealot
    Join Date
    Jul 2002
    Location
    USA
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well my host just "upgraded" and apparently turned off local load infile for all users. As the root of the phpMyAdmin I can't even upload a csv file.

    I tried through a php script to have LOCAL removed as well and then get an error message about
    Access denied for user: 'mycdcta@localhost' (Using password: YES)
    Now I'm seeing notes about doing MySQL commands at the shell level (why do we have to go there still)..but also commands about "mysql_options()"..could someone explain how to use the mysql_options command in a php script? here is what I had..

    PHP Code:
        $load_sql 'LOAD DATA INFILE \''.$textfile.'\' REPLACE INTO TABLE `'.$HTTP_POST_VARS['table'].'` FIELDS TERMINATED BY \',\' LINES TERMINATED BY \'\r\' IGNORE '.$HTTP_POST_VARS['rows'].' LINES';  
      
    mysql_select_db($database_mycdcta$mycdcta);
      
    $Result1 mysql_query($load_sql$mycdcta) or die(mysql_error()); 

  5. #5
    SitePoint Enthusiast
    Join Date
    May 2003
    Location
    Lincoln NE
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    most of the time when I interact with mySQL databases on my web hosting servers or mySQL on my local machines, I use a program called MySQL Front. it's a free software and one of the best programs to interact with MySQL.
    all you have to do is type the follwoing coomand and it'll take care of the rest for you.
    LOAD DATA INFILE 'C:/mysql/yourdb/file.txt' INTO TABLE yourdb.member

    You can download the software from:
    http://efux.de/mysqlfront/MySQL-Front_2.5_Setup.exe
    Hope this will help.

  6. #6
    SitePoint Zealot
    Join Date
    Jul 2002
    Location
    USA
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have phpMyAdmin..however the LOAD DATA LOCAL was not enabled when they compiled MySQL on update it appears. So I don't think it would work with either...


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
  •