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)
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.
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>
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.
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.
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”.
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