List:General Discussion« Previous MessageNext Message »
From:Egor Egorov Date:August 29 2002 11:08am
Subject:Re: Re: load data into table from file or how to set the local-infile=1
View as plain text  
Mertens,
Wednesday, August 28, 2002, 6:52:12 PM, you wrote:

MB> On Wed, 2002-08-28 at 16:51, Egor Egorov wrote:
>> Put into my.cnf file :
>> [mysql]
>> local-infile=1
>> 
>> or start mysql client with --local-infile=1 option.

MB> I tried the first option and it works when use the following command to
MB> load the data-file:
MB> mysql> LOAD DATA LOCAL INFILE '/home/M8ram/testmysql/pet.txt' INTO TABLE
MB> pet;
MB> Query OK, 3 rows affected (0.19 sec)
MB> Records: 3  Deleted: 0  Skipped: 0  Warnings: 0

MB> But when I use the above command without the LOCAL option it displays
MB> the following error:
MB> mysql> LOAD DATA INFILE '/home/M8ram/testmysql/pet.txt' INTO TABLE pet;
MB> ERROR 1045: Access denied for user: 'M8ram@localhost' (Using password:
MB> NO)

MB> Is this 'normal behaviour'?

Yes, if you don't have FILE_priv.

If you use LOAD DATA INFILE (without LOCAL), MySQL reads file from
server host and user must have FILE_priv.
Note: FILE_priv is a global privilege.

MB> About the second suggestion: where should this file be located?

What file? pet.txt or my.cnf?

MB> Is it possible that it does not exist yet?

Yes.

MB> If so can I create a file named
MB> "my.cnf" with a text-editor (like KWrite) and put it in my home
MB> directory?

Yes, you can create it by yourself.
Depends on what options you want to specify in my.cnf you should put
this file into /etc/my.cnf or MYSQL_DATADIR/my.cnf or into home_dir/

Read some more info here:
     http://www.mysql.com/doc/en/Option_files.html


MB> Thanks for the help!



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   Egor.Egorov@stripped
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com


Thread
load data into table from file or how to set the local-infile=1variableMertens Bram28 Aug
  • Re: load data into table from file or how to set the local-infile=1Egor Egorov28 Aug
    • Re: load data into table from file or how to set the local-infile=1Mertens Bram28 Aug
      • Re: Re: load data into table from file or how to set the local-infile=1Egor Egorov29 Aug
  • Re: load data into table from file or how to set the local-infile=1Gerald Clark28 Aug
    • Re: load data into table from file or how to set the local-infile=1Mertens Bram28 Aug
      • Re: load data into table from file or how to set the local-infile=1Keith C. Ivey29 Aug
        • Re: load data into table from file or how to set the local-infile=1Mertens Bram29 Aug
    • Re: load data into table from file or how to set the local-infile=1Gerald Clark29 Aug