View previous topic :: View next topic |
Author |
Message |
jonleow -
Joined: 29 Apr 2004 Posts: 48
|
Posted: Wed May 19, 2004 4:20 pm Post subject: LOAD DATA LOCAL problem |
|
|
i seem to have a problem with the load data local function.
- i have enable it by using this command: --local-infile[=1]
and i cant load a txt file ex.'pet.txt' into my table called pet. i always get this error : File 'pet.txt' not found (Errcode: 2)
is there anything with the coding above? is my code enabling the load data local wrong? |
|
Back to top |
|
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Fri May 21, 2004 2:17 pm Post subject: Re: LOAD DATA LOCAL problem |
|
|
jonleow,
Can you please give us more information about the context of this error? What is the script/scripting language you're using? _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
 |
jonleow -
Joined: 29 Apr 2004 Posts: 48
|
Posted: Fri May 21, 2004 3:28 pm Post subject: |
|
|
hi, i created a folder named database and another folder named mysql in my abyss web server dir. I read from the mysql manual that comes together with the download of mysql, that to insert a record into our database table (named 'pet' for my case), we can use the 'load data local' method. In the folder of mysql, there are several other sub folders and one of them is called 'data'. That is where my created database 'menagerie' is stored. So my menagerie database contain one table and that is pet. So i use this coding as described by the manual to load a txt file into it:
mysql> LOAD DATA LOCAL INFILE "pet.txt" INTO TABLE pet;
i got this error:
File 'pet.txt' not found (Errcode: 2) |
|
Back to top |
|
 |
Moxxnixx -
Joined: 21 Jun 2003 Posts: 1226 Location: Florida
|
Posted: Fri May 21, 2004 5:08 pm Post subject: |
|
|
jonleow,
When accessing MySQL, do you have FILE privileges?
The LOAD DATA INFILE statement requires this. |
|
Back to top |
|
 |
jonleow -
Joined: 29 Apr 2004 Posts: 48
|
Posted: Fri May 21, 2004 6:42 pm Post subject: |
|
|
how do i check whether i have it? |
|
Back to top |
|
 |
Moxxnixx -
Joined: 21 Jun 2003 Posts: 1226 Location: Florida
|
Posted: Fri May 21, 2004 7:49 pm Post subject: |
|
|
Easy way to grant privileges - If you have PHPMyAdmin installed, just click on privileges and
look at root user settings.
Alternative way to grant privileges - You must use the GRANT statement. Look here for more info:
http://mysqld.active-venture.com/GRANT.html |
|
Back to top |
|
 |
jonleow -
Joined: 29 Apr 2004 Posts: 48
|
Posted: Fri May 21, 2004 8:27 pm Post subject: |
|
|
hi MOXXNIXX , i think i will hold on to this problem first and learn the other features of sql. Thanks for the help offered. |
|
Back to top |
|
 |
|