Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Location
    Peterburg, Russija
    Posts
    7

    Unhappy Unanswered: Connecting to mysql

    Connecting to MySQL

    When i try to connect to MySQL, i cannot do it .

    The message in log file MyServe.err is:

    Number of processes running now: 0
    040227 13:25:04 mysqld restarted
    040227 13:25:04 InnoDB: Started
    /usr/local/libexec/mysqld: ready for connections.
    Version: '4.0.15-log' socket: '/tmp/mysql.sock' port: 3306


    I connect from java file:

    import java.sql.*;

    public class CoreConnect{
    public static void main(String[] args){
    try{
    Class.forName("com.mysql.jdbc.Driver");
    }catch(Exception e){
    e.printStackTrace();
    }
    try{
    Connection c =
    DriverManager.getConnection("jdbc:mysql://localhost:3306/test?user=kolya");
    c.close();
    }catch (SQLException e){
    e.printStackTrace();
    }
    }
    }

    in java i get ecception: java.sql.SQLException: Communication link failure: java.io.EOFException, underlying cause: null

  2. #2
    Join Date
    Mar 2004
    Location
    India
    Posts
    2

    Smile

    Hai,

    I have a solution for your problem.Install the driver using the folloeing mysql driver.

    class.forName("org.gjt.m.mysql.Driver");


    Good bye.

Posting Permissions

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