I have a 2 part question.

First problem: I simply can't get the LOAD DATA INFILE command to work. I'm trying to load a txt file into a very simple database. I get the following error When I do the following query:

LOAD DATA INFILE "cars.txt" INTO TABLE cars

I get this error:

Access denied for user: 'xwreck@localhost' (Using password: YES)

When I add "LOCAL" to the input:

LOAD DATA LOCAL INFILE "cars.txt" INTO TABLE cars

I get this error:

Error 1148: The used command is not allowed with this MySQL version

Any ideas on why this doesn't work for me?

Now, the 2nd question I had is: Can the file I reference in the LOAD DATA query be a full URL: ex: http://www.yahoo.com/file.txt

Thank you for your help.

    There are comments on this problem in the searchable section of the MySQL documentation at mysql.com (it's under chapter 6, uggh why do I know that).

    It would be helpful to know which version of MySQL you are using. In something like 3.23.52 they turned this off by default but the command to turn it back on didn't work properly and they reversed it under 3.23.54.

    In the latest release version 4.0.16 it is off again and, at least under some circumstances you have to turn it by using the wrong command, instead of 1 use 0 to turn it on (that happened on my Mac OS and under some windows installs, not sure about other *nix versions).

    Assuming you have access to the admin use:

    /path-to-mysql/bin --local-infile=(either 0 or 1) -u root -p

    and enter your password at the prompt. You can also add the command in the /etc/my.cnf file (on Linux, not sure of the location on other systems) so that on startup it knows to allow the command.
    Or on restart adding the --local-infile=0/1 option.

    This is a pain that the mysql developers created without consulting the user community and it's not clear how it'll be resolved (at least that's my take on it).

    good luck many folks have spent much time trying to get their systems to work properly with this command.

    HTH

    rinjani

      Write a Reply...