To administer your WestHost account, please enter your
Domain Name or Server Manager Username.

WestHost: Professional Website Hosting Company








Results 1 to 7 of 7
  1. #1
    Junior Member
    Join Date
    Aug 2003
    Posts
    5

    Default mysql - can we load a data file (enable local-infile)

    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
    Last edited by dcardena; 03-24-2011 at 05:31 PM.

  2. #2
    Senior Member FZ's Avatar
    Join Date
    May 2003
    Location
    Johannesburg, South Africa
    Posts
    1,024

    Default

    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.
    Fayez Zaheer

  3. #3
    Junior Member
    Join Date
    Aug 2003
    Posts
    5

    Default

    Quote Originally Posted by FZ
    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
    Last edited by dcardena; 03-24-2011 at 05:32 PM.

  4. #4
    Senior Member FZ's Avatar
    Join Date
    May 2003
    Location
    Johannesburg, South Africa
    Posts
    1,024

    Default

    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.
    Fayez Zaheer

  5. #5
    Senior Member FZ's Avatar
    Join Date
    May 2003
    Location
    Johannesburg, South Africa
    Posts
    1,024

    Default

    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...
    Fayez Zaheer

  6. #6
    Junior Member
    Join Date
    Aug 2003
    Posts
    5

    Default

    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
    Last edited by dcardena; 03-24-2011 at 05:32 PM.

  7. #7
    Senior Member FZ's Avatar
    Join Date
    May 2003
    Location
    Johannesburg, South Africa
    Posts
    1,024

    Default

    Cool
    Fayez Zaheer

Similar Threads

  1. Data Modelling tool to use with MySQL
    By Hitesh in forum PHP / MySQL
    Replies: 1
    Last Post: 10-26-2007, 06:53 PM
  2. Miva 4 to Miva 5 upgrade problems Did this happen to you?
    By brady9111 in forum Miva Merchant
    Replies: 3
    Last Post: 05-25-2007, 11:11 AM
  3. Replies: 3
    Last Post: 03-15-2007, 09:32 PM
  4. Replies: 19
    Last Post: 04-05-2006, 05:42 PM
  5. Replies: 10
    Last Post: 07-06-2005, 11:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •