PDA

View Full Version : mysql - can we load a data file (enable local-infile)



dcardena
04-02-2004, 07:51 PM
I tried shutting down mysql, then starting it from /usr/libexec/ with:
shell> mysql --local-infile=1

which didn't throw any errors and looks like it should work according to the manual: http://www.mysql.com/doc/en/LOAD_DATA_LOCAL.html

but when I try to load data into a table with:
shell> load data local infile 'data.txt' into table test;

I get the error:
ERROR 1148: The used command is not allowed with this MySQL version

which is the error the manual says I'll get if LOAD DATA LOCAL INFILE is disabled, either in the server or the client.

any thoughts?
________
HONDA CT70 (http://www.cyclechaos.com/wiki/Honda_CT70)

FZ
04-02-2004, 08:17 PM
First of all, I'd recommend doing a restart via SSH to make sure that mySQL is launched as WestHost intended it to (i.e. configured to work in this environment).

Secondly, if you can't achieve what you are trying via SSH, you should give PhpMyAdmin a go - it'll let you do what you are trying (and LOTS of other things) via your browser (GUI as opposed to text), and it all works 100% instead of spitting an uninformative error. You can install PhpMyAdmin via Site Applications in your Site Manager.

dcardena
04-02-2004, 08:53 PM
First of all, I'd recommend doing a restart via SSH to make sure that mySQL is launched as WestHost intended it to (i.e. configured to work in this environment).

Do you mean an Apache restart or MySQL restart? I don't see how an Apache restart would make a difference- am I missing something? I did restart MySQL- I shut it down and started it with the --local-infile=1 option, that didn't seem to work.

Thanks or the PhpMyAdmin suggestion, but I'm doing this in an effort to gain more familiarity with MySQL queries.

Anyone have any luck enabling this option via command line?
________
ASS OILED (http://www.fucktube.com/categories/159/oiled/videos/1)

FZ
04-03-2004, 07:40 AM
A "restart" via SSH restarts both the Apache AND mySQL processes.

I'll look into this (try it myself), and if I come up with anything, I'll let you know. If you come up with anything, please post it here too.

FZ
04-03-2004, 08:46 AM
Here's something you can try:

Add this line: local-infile=1

to your /etc/my.cnf file (in the [mysql] "section"), and then restart via SSH and try again...

dcardena
04-03-2004, 09:35 AM
awesome! that did it-

Here's what I did:

edit my.cnf in /etc/:
----------------------------------------
[mysqld]
...(other stuff)
local-infile=1
[mysql]
...(other stuff)
local-infile=1

then shutdown, then start mysql:
----------------------------------------
shell> mysqladmin shutdown
shell> cd /usr/libexec
shell> mysqld

then I have to close that shell connection and open a new one, then:
--------------------------------------------------------------------------------
shell> mysql



and vo?la!

Thanks!
________
Amateur Tube Videos (http://www.fucktube.com/)

FZ
04-03-2004, 10:16 AM
Cool :)