PDA

View Full Version : Uploading text file for MySQL table



Anonymous
10-24-2003, 11:59 PM
Hello,

After trying a bunch of ways to insert data into a table in my MySQL db using the PHPAdmin and a local file , I was wondering if something is not compatible. The error I always receive no matter how simple I make the data ( 2 fiields, two rows etc) or change load data syntax variables is always

Database info14_rtess - Table first running on localhost

Error

SQL-query :

LOAD DATA LOCAL INFILE '/tmp/phpykP2NN' REPLACE INTO TABLE `first`
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY 'rn'

MySQL said:

The used command is not allowed with this MySQL version

I can manually insert values and populate the table, so the db and fileds are OK, but the bulk uploading is not working. Is it the location of the text file ( although the temp directory seems fine) or is it still some incompatibility between the Load data syntax?

Any thoughts?

Thanks
Paul

Anonymous
10-25-2003, 12:21 AM
Hello again,

I just read further in the online MySQL manual regarding Loading Data and the error message (1148):

The used command is not allowed with this MySQL
version error message (1148):

It seems as though with newer versions of MySQL there is a built in issue regarding security and requires some modification to the MySQL command line (which I don't think is possible with PHPAdmin or requires configured MySQL with --enable-
local-infile otherwise
if attempting to use the "load data local" syntax with
the local clients not configured MySQL with --enable-
local-infile you receive error message 1148).

Does this sound correct and therefore was or can the MySQL be complied to include the enable-local-infile option?
The other option is to write some PHP code that will allow flexibilty in the command lines etc. This of course would require some brushing up on PHP as well for me.


Thanks again
Paul