LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 05-16-2009, 08:53 PM   #1
linuxqueric
Member
 
Registered: Apr 2007
Posts: 41

Rep: Reputation: 15
Load data local


I'm working with MySQLrefman-5.0 and running MySQL 5.0.51a. When I try to use the command as indicated in the tutorial in Ch. 3, I get the message that "this command is not allowed with this version." In section 5.6.4 of the manual it talks about enabling Load Data Local. But I'm not understanding it.

The manual says, "By default, all MySQL clients and libraries in binary distributions are compiled with the --enable-local-infile option." So why can't I use that command? (I did not build it from source but installed it using Yast.)

A bit further the manual says, "For the mysql command-line client, LOAD DATA LOCAL can be enabled by specifying the --local-infile[=1] option." But it doesn't say where to specify it. I tried including it in my command to start mysql but got a syntax error message.
Quote:
eric@linux-pczd:~> mysql --local-infile[=1] -u eric -p
mysql: unknown variable 'local-infile[=1]'
I also tried restarting mysqld with the --local-infile=1 option. That command seemed to work. But I still can't use the Load Data Local command, so something is still wrong on the client side, I guess. (Client and server are on the same host.)

Thanks.
 
Old 05-17-2009, 03:38 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,938

Rep: Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330
Quote:
A bit further the manual says, "For the mysql command-line client, LOAD DATA LOCAL can be enabled by specifying the --local-infile[=1] option." But it doesn't say where to specify it. I tried including it in my command to start mysql but got a syntax error message.
The "--local-infile[=1]" expressions means that you have to add "--local-infile" or "--local-infile=1" in the startup options of mysqld, to enable LOAD DATA LOCAL.
If you want, you can to do the same by adding this option (add the line: local-infile=1) in the [mysqld] part of /etc/my.cnf.
Regarding the client, you can also add this option in the [client] part of my.cnf. Take a look at this to see the security issues about it.

Regards

Last edited by bathory; 05-17-2009 at 03:50 AM.
 
Old 05-18-2009, 02:19 PM   #3
linuxqueric
Member
 
Registered: Apr 2007
Posts: 41

Original Poster
Rep: Reputation: 15
Thanks, Bathory.

I tried this and still get the same error message.
Quote:
mysql> LOAD DATA LOCAL INFILE '/home/eric/animal.txt' INTO TABLE pet;ERROR 1148 (42000): The used command is not allowed with this MySQL version
This is the relevant part of my.cnf:

Quote:
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /var/lib/mysql/mysql.sock
local-infile = 1

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
local-infile=1
user=mysql
By the way, the page you referred me to is the one I was studying. When it says that all versions since ... are enabled with this option, doesn't that mean it should work as the default?
 
Old 05-18-2009, 02:27 PM   #4
linuxqueric
Member
 
Registered: Apr 2007
Posts: 41

Original Poster
Rep: Reputation: 15
I got it to work--had to specify "local-infile=1" in my command to start mysql. I was trying to specify it in the "Load Data Local Infile" command.

But once I've made the change (noted in previous post) to the client part of my.cnf, I shouldn't have to also do it when starting mysql, should I?

Thanks.

Last edited by linuxqueric; 05-18-2009 at 02:39 PM.
 
Old 05-18-2009, 04:50 PM   #5
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,938

Rep: Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330
I guess that you have to specify the localt-infile option in the startup script of mysqld, because the settings in my.cnf get overwritten by the startup options.
Anyway glad to see you've made it.

Regards
 
  


Reply

Tags
data, load, local, mysql


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Load balancing two isp and two local run_time Linux - Networking 0 01-12-2008 12:15 PM
Deliver data from form to local mailbox enixitan Linux - Software 1 02-27-2007 01:14 PM
cannot load local code page transcoder arshipel Linux - Software 0 03-16-2005 09:43 AM
Local data transfer software? R00ts Linux - Software 1 05-25-2004 07:47 AM
rc.local - does not load during boot Beuzekom Linux - Newbie 13 04-28-2004 11:25 AM


All times are GMT -5. The time now is 11:34 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration