Joinutility seperatorLogin utility separator Infobright.com
   
1 of 2
1
errorcode 13 problem
Posted: 11 December 2008 11:01 AM   Ignore ]  
Newbie
Avatar
Rank
Total Posts:  25
Joined  2008-10-24

I have my brandnew redhat 64bit server running, which my provider setup for me. I have basic access and infobright 64 enterprise is installed and running.

I was able to access the database server, create a database and table and wanted to load data from a file (1million generated lines of ascii data seperated by ;).

mysql> load data infile ‘/home/SP_admin/tools/datagenerator/generated_data.csv’ into table test1 fields terminated by ‘;’;

when I do so, I get following error:

ERROR 13 (HY000): Can’t get stat of ‘/home/SP_admin/tools/datagenerator/generated_data.csv’ (Errorcode: 13)

can somebody point me to the error, please.

rgds,

uwe geercken

Profile
 
Posted: 11 December 2008 11:26 AM   Ignore ]   [ # 1 ]  
Sr. Member
Avatar
RankRankRankRank
Total Posts:  736
Joined  2008-08-18

Hi Uwe,

I believe you’d already checked the file access priviledges etc. If you’re using Enterprise Edition, please don’t forget about executing set @bh_dataformat = ‘txt_variable’; before the load.

Regards,

Signature 
Profile
 
Posted: 11 December 2008 11:27 AM   Ignore ]   [ # 2 ]  
Member
RankRankRank
Total Posts:  220
Joined  2008-08-18

Hi

Could you check the permission on your .csv file? I checked mysql bug list. There is a solution by giving proper permission.

chmod 755 .
chmod 744 generated_data.csv

It might also need same permission on parent folders.

You can also look at:
http://bugs.mysql.com/bug.php?id=31670

regards

Signature 

Mahib

Profile
 
Posted: 11 December 2008 11:44 AM   Ignore ]   [ # 3 ]  
Newbie
Avatar
Rank
Total Posts:  25
Joined  2008-10-24

ok I did that. but now I get an error of:

ERROR 1 (HY000): Cannot open file or pipe

I checked twice and the file is there and readable. any idea?

tks,

uwe

Profile
 
Posted: 11 December 2008 11:51 AM   Ignore ]   [ # 4 ]  
Newbie
Avatar
Rank
Total Posts:  25
Joined  2008-10-24

hello everybody. to make life easier, here is the dump from my terminal.

here is my file:

-rwxr—r—1 SP_admin swissport 90953898 Dec 11 10:23 generated_data.csv


and here my mysql client:

[SP_admin@CHZRHOSPSV0098 datagenerator]$ /usr/local/infobright-3.0-x86_64/bin/mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.14 build number (revision)=1730

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> use swissport_test1;
Database changed
mysql> set @bh_dataformat=‘txt_variable’;                          Query OK, 0 rows affected (0.00 sec)

mysql> load data infile ‘/home/SP_admin/tools/datagenerator/generated_data.csv’ into table test1 fields terminated by ‘;’;
ERROR 1 (HY000): Cannot open file or pipe.
mysql>

hope you can help.

uwe

Profile
 
Posted: 11 December 2008 12:20 PM   Ignore ]   [ # 5 ]  
Jr. Member
Avatar
RankRank
Total Posts:  96
Joined  2008-08-18
uwegeercken - 11 December 2008 11:44 AM

ok I did that. but now I get an error of:

ERROR 1 (HY000): Cannot open file or pipe

I checked twice and the file is there and readable. any idea?

tks,

uwe


To be sure, can you do a:

head /home/SP_admin/tools/datagenerator/generated_data.csv 
Signature 

Brian Beharry, QA
Infobright

Profile
 
Posted: 11 December 2008 12:29 PM   Ignore ]   [ # 6 ]  
Jr. Member
Avatar
RankRank
Total Posts:  96
Joined  2008-08-18

Also, from the MySQL Montior, can you issue:

system head /home/SP_admin/tools/datagenerator/generated_data.csv 


And what user are you when you start the server?  That user needs to be able to run “head” on the file.

Signature 

Brian Beharry, QA
Infobright

Profile
 
Posted: 11 December 2008 12:37 PM   Ignore ]   [ # 7 ]  
Member
RankRankRank
Total Posts:  220
Joined  2008-08-18

This looks like some permission issue.  Can you copy this file in /tmp directory and set permission 777 to this file and try load?

Signature 

Mahib

Profile
 
Posted: 11 December 2008 12:50 PM   Ignore ]   [ # 8 ]  
Member
RankRankRank
Total Posts:  106
Joined  2008-08-18

Is it possible that you run mysqld in one user, and mysqlclient with another user? Check the file permission from /, permission could break in the middle.

Profile
 
Posted: 12 December 2008 07:14 AM   Ignore ]   [ # 9 ]  
Newbie
Avatar
Rank
Total Posts:  25
Joined  2008-10-24

very strange: I can do a

system head /home/SP_admin/tools/datagenerator/generated_data.txt

..and get the data from the file displayed in the mysql client.

when I try

load data infile ....

I get errorcode 13.

further, when I copy the file to /tmp it does work.


here are some more details:

[SP_admin@CHZRHOSPSV0098 datagenerator]$ pwd
/home/SP_admin/tools/datagenerator

[SP_admin@CHZRHOSPSV0098 datagenerator]$ ll
total 176
-rwxrwxrwx 1 SP_admin swissport 83921 Dec 12 12:02 generated_data.txt

maybe someone finds a solution.

rgds,

uwe

Profile
 
Posted: 12 December 2008 08:36 AM   Ignore ]   [ # 10 ]  
Member
RankRankRank
Total Posts:  220
Joined  2008-08-18

So keeping the load files outside the /home/SP_admin directory works.

If you run the server as per our instruction, then we guess server is running by system user root/mysql. Therefore,
when it tries to load a file from other user’s home directory /home/SP_admin, it gets permission denied. Although root should have access to any place.

regards,

Signature 

Mahib

Profile
 
Posted: 14 May 2009 04:01 PM   Ignore ]   [ # 11 ]  
Sr. Member
Avatar
RankRankRankRank
Total Posts:  505
Joined  2008-08-18
Brian Beharry - 11 December 2008 12:29 PM

Also, from the MySQL Montior, can you issue:

system head /home/SP_admin/tools/datagenerator/generated_data.csv 


And what user are you when you start the server?  That user needs to be able to run “head” on the file.

When you do the “system” command, it’s executed as the user running the mysql client (namely, your own user account).

When you do LOAD DATA INFILE, it’s executed as the user running the mysqld server process.

To load data, the mysqld server process user needs read permission on the file, and read+execute permission on all parent directories. Normally this process runs as user “mysql”.

Geoffrey

Signature 
Profile
 
Posted: 14 May 2009 05:33 PM   Ignore ]   [ # 12 ]  
Super Duper Member
Avatar
RankRankRankRankRank
Total Posts:  916
Joined  2008-08-18

Also, SElinux can be involved. It may block access to some directories for some processes. See http://www.infobright.org/wiki/Linux_Tuning/

Profile
 
Posted: 18 May 2009 04:53 AM   Ignore ]   [ # 13 ]  
Jr. Member
RankRank
Total Posts:  75
Joined  2008-10-22

ICE is running as its own user, thats why it cannot access any file inside/below /home.

Chmodding the file itself wont help as long as the directory (or the one above that one) is not accessible by mysql/ice.  this is a general problem for all kind of appilactions that are run with their own uid

Moving the file to a accessible directory outside /home and setting the correct access privileges should solve the problem generally. I’ld recommend

mv file /tmp/.
chmod o+r /tmp/file

Chris

Signature 

Chris (cvh@LE),
Leipzig, Germany

Profile
 
Posted: 02 February 2010 12:42 AM   Ignore ]   [ # 14 ]  
Newbie
Rank
Total Posts:  32
Joined  2009-11-09

I am encountering same problem.

My server is running as user ibtest (system whoami returns ibtest).
The folder and data files are owned by ibtest and have ALL permissions.

Even then, load data infile fails to read the file.

However, when I copy the data file into /tmp it works.
But, I cant copy all the files to /tmp for loading, especially when I am production ready.

Is there a solution to this ?

Profile
 
Posted: 02 February 2010 08:38 AM   Ignore ]   [ # 15 ]  
Super Duper Member
Avatar
RankRankRankRankRank
Total Posts:  916
Joined  2008-08-18

What about SELinux settings (as indicated in a previous post)?

Profile
 
   
1 of 2
1