Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:8337 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3929 invoked by uid 1010); 3 Mar 2004 10:22:45 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 3601 invoked from network); 3 Mar 2004 10:22:43 -0000 Received: from unknown (HELO tresx.eurolloyd.int) (62.15.140.95) by pb1.pair.com with SMTP; 3 Mar 2004 10:22:43 -0000 Received: from tresx.eurolloyd.int (tresx.eurolloyd.int [127.0.0.1]) by tresx.eurolloyd.int (8.12.8/8.12.8) with ESMTP id i23AMgeY031443 for ; Wed, 3 Mar 2004 11:22:43 +0100 Received: from ([192.168.0.156]) by tresx.eurolloyd.int (MailMonitor for SMTP v1.2.2 ) ; Wed, 3 Mar 2004 11:22:42 +0100 (CET) Date: Wed, 3 Mar 2004 11:21:01 -0800 Mime-Version: 1.0 (Apple Message framework v553) Content-Type: text/plain; charset=ISO-8859-1; format=flowed To: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: X-Mailer: Apple Mail (2.553) Subject: LOAD DATA LOCAL INFILE from php From: lmartinez@eurolloyd.es (=?ISO-8859-1?Q?Luis_Martinez_Ordo=F1ez?=) I have a RedHat 7.3 with a mysql-3.23.49-3 and php-4.1.2-7 mysql was installed as an rpm, that have --local-infile=3D0 as default. I=B4m trying to load a csv file into mysql from a php script, trying not=20= to install again mysql from source, nor rebuild the rpm package. So I found that if I make the connect script in php as mentioned in=20 bugs.php.net forum: if you made a connection with mysql_connect() and specify 128 as fifth parameter (options), you can perform sql LOAD DATA LOCAL INFILE statements. the file accesses are made by mysql client library, so you can access any file which webserver process can access to, IGNORING open_basedir option! (and perhaps also safe-mode uid/gid checks, i don't know...) $m=3Dmysql_connect($host, $user, $pass, false, 128); // connect with MYSQL_OPT_LOCAL_INFILE (in php manual undocumented)=20= option it doesn=B4t work, displaying an error. Any suggestions? Do I need to install mysql with the --local-infile option turned on for=20= proper operation? The database in for internal use only, in an intranet, without public=20 access. Thanks in advance. -------------------------- Luis Mart=EDnez Ordo=F1ez=