Jump to content

Newbie Data Import PHP command not working


irabelle1994

Recommended Posts

I am having error while using load data local infile on button..

--here's the code-

sc_exec_sql("load data local infile '/PATH/IMPORT/FILE' into table TABLETOIMPORT fields terminated by '\t' lines terminated by '\n'")

 

this script returns:

 

Error while accessing the database:

The used command is not allowed with this MySQL version

 

but it works fine when i execute this same script on mysql on server(Ubuntu server)

 

load data local infile '/PATH/IMPORT/FILE' into table TABLETOIMPORT fields terminated by '\t' lines terminated by '\n'

 

How to solve this problem?? 

 

Below are the details of my development environment

 

Ubuntu 13.04

PHP 5.49

MySQL 14.14

Rapid Development Tool - Scriptcase 7.1

 

Will appreciate your help :)

 

Ira

Link to comment
Share on other sites

I have no idea why you think thought this was a regex question...

 

Google:

1. "The used command is not allowed with this MySQL version"

2. Result #2: Security Issues with LOAD DATA LOCAL

3.

If LOAD DATA LOCAL is disabled, either in the server or the client, a client that attempts to issue such a statement receives the following error message:

 

ERROR 1148: The used command is not allowed with this MySQL version

 

So now you should be asking "okay, then is it disabled on the server or on the client?" To check if it's the server:

4.

You can disable all LOAD DATA LOCAL statements from the server side by starting mysqld with the --local-infile=0 option.

Link to comment
Share on other sites

Hi sorry for posting here. just joined and not really familiar with PHP and MySQL really a newbie....my officemate and I have already set the Load Data Local to 1 (enabled), that is why we have been able to execute the command at the command line, but when we place this same code in our PHP program, it is giving us the error "The used command is not allowed with this MySQL version."

 

Dont know how to proceed from there. Tried a lot of the threads we found via Google before we posted here. 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.