The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

mysql problem

Discussion in 'General Discussion' started by anand, Sep 11, 2004.

  1. anand

    anand Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    1,435
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    I got a customer with a strange problem.

    He is using the following on the command line in mysql and it works without a flaw

    PHP:
    LOAD DATA LOCAL INFILE
    Now when he tries to use the same inside his servlets, he gets errors. He was using the same code on a other server where it didn't have cpanel, it was a custom install done by someone for mysql.

    What i fail to understand is when it works on the command line why not from inside the servlets ?

    Any ideas ?
     
  2. zentity

    zentity Well-Known Member

    Joined:
    Jun 16, 2004
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    The LOAD DATA LOCAL command can only be used if your php has been compiled --with-mysql=/usr or your application is using those libraries. (I assume you mean php when you say servlets? ).
    Recompiling php to use the MySQL libraries instead of the bundled ones should solve the problem. (--with-mysql=/usr)

    More info from php.net: http://nz2.php.net/mysql and MySQL.com: http://dev.mysql.com/doc/mysql/en/LOAD_DATA_LOCAL.html
     
  3. anand

    anand Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    1,435
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    servlets is not php. its java. thx for the info on php though.
     
  4. Ancile

    Ancile Member

    Joined:
    Jun 26, 2003
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Are you using a connect string with the java?

    I know that if you use MYSQL_OPT_LOCAL_INFILE in the connect string in PHP, it can switch this feature on, i'm assuming you would be able to use the same with java... if using a connect string.

    of course i could be completely wrong! :)
     
  5. anand

    anand Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    1,435
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    Its actually a customer box so i am not pretty sure and java is certainly not my cup of tea (correction coffee ;))

    Could you explain about what you mean by the connect string in java ? I could perhaps pass this to my customer.

    Thx.
     
  6. Ancile

    Ancile Member

    Joined:
    Jun 26, 2003
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Hi Anand,

    basically PHP has to connect to the mysql server with a username & password before any data can change hands, i'm assuming this will be the same with the java servlet's... as far as i am aware the following connect string in PHP enables the feature your looking for;

    mysql_connect ( server, user, password, false, MYSQL_OPT_LOCAL_INFILE)

    Hope this helps.

    -ANUK.
     
  7. anand

    anand Well-Known Member

    Joined:
    Nov 11, 2002
    Messages:
    1,435
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    Thx for the info.
     
Loading...

Share This Page