PHP Web Host - Quality Web Hosting For All PHP Applications Sign up for PayPal and start accepting credit card payments instantly
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 889

PostPosted: Mon Aug 15, 2005 5:55 pm Reply with quote Back to top

Raven do you happen to know how and or where to set --local-infile=0 in order to allow for text uploading from local host?

I have read every manual under the sun....they all send you around in circles.....

I have found my my.cnf but I can not find the correct syntax for the command.

This is on a local testing server so I am not worried about the security issues with in....I just need the correct syntax!

Thank You for your help!

Dawg
View user's profile Send private message
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 889

PostPosted: Mon Aug 15, 2005 7:22 pm Reply with quote Back to top

OK...After a DAY of searching I found this.....I hope it works!!!!

Dave



LOAD DATA LOCAL INFILE error: "The used command is not allowed with this MySQL version" when trying to import data in phpMyAdmin or mysql prompt. What is causing this?

Answer: This is because the newest version of MySQL has disabled local file access due to security reasons. This LOAD DATA statement has to be used from the unix mysql prompt after making the changes below (it will not work from phpMyAdmin). The link to this article from MySQL explaining this is:
Only registered users can see links on this board!
Get registered or login to the forums!


Fix: To fix the problem and load data, you must edit your /etc/my.cnf file from unix and put the following in there for the last line OR you can pass the --local-infile=1 in the parameters when connecting to mysql prompt.

local-infile=1

When you're finished editing the file, it should look like the one below:

[client]
port=3306
host=127.0.0.1
local-infile=1

Once this file has been changed, you can import data using the mysql prompt only (not from phpMyAdmin).

1) Add the local-infile=1 statement to the /etc/my.cnf file using the vi editor. (if you don't know how to do this, e-mail
Only registered users can see links on this board!
Get registered or login to the forums!
and we'll change it for you).

2) FTP the files to your web site into the same directory where you're going to run the mysql command.

3) Connect from unix command line to the mysql command prompt via the following syntax:

mysql -u username -p -h youripaddress yourdatabasename

OR if you don't want to modify the /etc/my.cnf file, just use the following command instead:

mysql -u username -p -h youripaddress --local-infile=1 yourdatabasename

4) Once connected to mysql prompt, enter the LOAD DATA INFILE command to match your database and text file. The syntax for the command is at
Only registered users can see links on this board!
Get registered or login to the forums!


For example, the file below contains vehicle makes and is named "makes.txt".

"20","Ferrari"
"30","Lamborghini"


To load this file into a table called Makes that has 2 fields (MakeID, MakeName)

LOAD DATA LOCAL INFILE './make.txt' INTO TABLE
`Make` FIELDS TERMINATED BY ',' ENCLOSED BY '"'
LINES TERMINATED BY '\n'

(Keep in mind, after the ENCLOSED BY is a single quote, followed by a double quote, then another single quote.)


Only registered users can see links on this board!
Get registered or login to the forums!
View user's profile Send private message
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 889

PostPosted: Sat Aug 20, 2005 11:38 am Reply with quote Back to top

I am on a shared host.....and it did not work.

The way I got around it was to install phpdev. Excellent program for working locally. It is for testing only and is "lose" security wise. So I uploaded my data to a database there...then did an SQL dumo and uploaded that sql dump to my main server....worked like a champ!

Thanks...

Dawg
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Sat Aug 20, 2005 2:56 pm Reply with quote Back to top

I never saw your original post! I am sorry. I am glad that you have resolved it though.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum