Thanks a lot Joe, the LOAD DATA LOCAL did the trick, but just to be courius, why work LOAD DATA with user root but not with filasPOS user, and LOAD DATA LOCAL work with both users? thanks in advance
2008/1/8, joe <[EMAIL PROTECTED]>: > > forgot to mention that I an using 5.1 > I use mysql_local_infile=1 in the DB connect string > also use LOAD DATA local INFILE in the load statement > > Script run on the DB host and does not run as root. > Not special privs were need, the file just needed to be accessible from > mysqld > > -----Original Message----- > From: joe [mailto:[EMAIL PROTECTED] > Sent: Tuesday, January 08, 2008 12:01 AM > To: 'Mauricio Tellez' > Subject: RE: Odd behavior of 'load data' > > You may need to use LOAD DATA LOCAL INFILE. > > > -----Original Message----- > From: Mauricio Tellez [mailto:[EMAIL PROTECTED] > Sent: Monday, January 07, 2008 11:43 PM > To: Chris > Cc: mysql@lists.mysql.com > Subject: Re: Odd behavior of 'load data' > > That's the output of the stat command: > File: `/var/www/apache2-default/filas/admin/upload/rankeo_pos.csv' > Size: 2909 Blocks: 8 IO Block: 4096 archivo > regular > Device: 802h/2050d Inode: 672206 Links: 1 > Access: (0666/-rw-rw-rw-) Uid: ( 33/www-data) Gid: ( 33/www-data) > Access: 2008-01-07 23:43:21.000000000 -0600 > Modify: 2008-01-07 23:43:21.000000000 -0600 > Change: 2008-01-07 23:43:21.000000000 -0600 > > as you can see the file is rw for everybody and all the path has access > rights. Let me explain again, perhaps my english isn't good enough: I > create > a mysql root user with the following command: > *mysqladmin* -u *root password* "my_passwd" and if I connect with this > user like: > $db = mysqli_connect("localhost", "root", "my_passwd"); > mysqli_select_db($db, 'filasPOS'); > > I can use the load data statement without errors. But when I tried to > connect with the user filasPOS (you can see the grant statement that I use > with this user at my first post, and Moon's Father by the way, the output > of > the grant statement was: Query Ok, 0 rows affected) like this: > $db = mysqli_connect("localhost", "filasPOS", "mypasswd"); > mysqli_select_db($db, 'filasPOS'); > > and try to use the load data statement I got the error. I think this > really > is a mysql problem and no an OS file permision problem, because mysql > always > use the user mysqld is running to access the file specified by load data, > and the user you use to connect to mysql has nothing to do in that, am I > right? So, why this work properly with the root user but not with the > filasPOS user? Thanx for the help > > 2008/1/7, Chris <[EMAIL PROTECTED]>: > > > > Mauricio Tellez wrote: > > > Hi, I'm developing a PHP/MySQL app, and I use "load data infile" to > > > feed data to MySQL. At the develop server I haven't any error, the > > > app works great, but when I upload to the production server, all the > > > "load data infile" statements fails with an error like this: can't > > > stat path/to/my_cvs_file > > > > That's usually a file permission problem rather than a mysql one. > > > > If you have root access to the server, su to the mysql user and try: > > > > stat path/to/my_file > > > > does that work or give the same error? > > > > > > > -- > Mauricio Tellez > > Internal Virus Database is out-of-date. > Checked by AVG Free Edition. > Version: 7.5.516 / Virus Database: 269.17.13 - Release Date: 12/31/2007 > 12:00 AM > > > Internal Virus Database is out-of-date. > Checked by AVG Free Edition. > Version: 7.5.516 / Virus Database: 269.17.13 - Release Date: 12/31/2007 > 12:00 AM > > > Internal Virus Database is out-of-date. > Checked by AVG Free Edition. > Version: 7.5.516 / Virus Database: 269.17.13 - Release Date: 12/31/2007 > 12:00 AM > > > -- Mauricio Tellez