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

    Unhappy Unanswered: 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
    Oct 2003
    Location
    Slovakia
    Posts
    482

    Re: Connecting to MySQL

    Originally posted by KolyaA
    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
    Try "telnet localhost 3306" from shell. If you could to connect than probably is problem in your code or jdbc.

  3. #3
    Join Date
    Feb 2004
    Location
    Peterburg, Russija
    Posts
    7

    Re: Connecting to MySQL

    Originally posted by ika
    Try "telnet localhost 3306" from shell. If you could to connect than probably is problem in your code or jdbc.
    Thank you.

    When i tried "telnet localhost 3306", i received message:

    astro!kolya:~ >telnet localhost 3306
    Trying ::1...
    telnet: connect to address ::1: Connection refused
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    You are not welcome to use mysqld from localhost.
    Connection closed by foreign host.

    My administrator don't know what to do. He think reason in options
    of mysql, but he don't know about mysql. Does he right?

  4. #4
    Join Date
    Feb 2004
    Location
    Peterburg, Russija
    Posts
    7

    Re: Connecting to MySQL

    P.S. Simply "telnet localhost" works good

  5. #5
    Join Date
    Oct 2003
    Location
    Slovakia
    Posts
    482

    Re: Connecting to MySQL

    Originally posted by KolyaA
    P.S. Simply "telnet localhost" works good
    telnet localhost (without port specification) means you are telneting to default telnet port 23. If telnet localhost 3306 returns "Connection refused" it means your MySQL server is not running.
    If connection is successfully opened from localhost (to 3306) and if you receiving "Connection refused" when you connecting from anther machine, then check for firewall rules.

  6. #6
    Join Date
    Feb 2004
    Location
    Peterburg, Russija
    Posts
    7

    Re: Connecting to MySQL

    Originally posted by ika
    telnet localhost (without port specification) means you are telneting to default telnet port 23. If telnet localhost 3306 returns "Connection refused" it means your MySQL server is not running
    I think it is running. "Connection refused" concerns to "adress ::1".
    Atter that it "trying 127.0.0.1" and "Connected to localhost"
    But after each attempt "mysqld restarted" in errror log file

    [SIZE=1If connection is successfully opened from localhost (to 3306) and if you receiving "Connection refused" when you connecting from anther machine, then check for firewall rules. [/SIZE]
    "telnet localhost 3306" unsuccessful in all cases. And each time i receive the same message(as in my previous reply)

  7. #7
    Join Date
    Oct 2003
    Location
    Slovakia
    Posts
    482

    Re: Connecting to MySQL

    Originally posted by KolyaA
    I think it is running. "Connection refused" concerns to "adress ::1".
    Atter that it "trying 127.0.0.1" and "Connected to localhost"
    But after each attempt "mysqld restarted" in errror log file



    "telnet localhost 3306" unsuccessful in all cases. And each time i receive the same message(as in my previous reply)
    Ok clud you explain your architecture (OS and from where you are connecting to mysql (localhst or another host))
    BTW, What the error log say?

  8. #8
    Join Date
    Feb 2004
    Location
    Peterburg, Russija
    Posts
    7

    Re: Connecting to MySQL

    I am connecting from localhost.
    OS is: FreeBSD 5.0
    MySQL-server 4.0.18-log
    MySQL-client 4.0.18

    Error log say:

    Number of processes running now: 0
    040301 14:03:23 mysqld restarted
    040301 14:03:24 InnoDB: Started
    /usr/local/libexec/mysqld: ready for connections.
    Version: '4.0.15' socket: '/tmp/mysql.sock' port: 3306

  9. #9
    Join Date
    Oct 2003
    Location
    Slovakia
    Posts
    482

    Re: Connecting to MySQL

    Originally posted by KolyaA
    I am connecting from localhost.
    OS is: FreeBSD 5.0
    MySQL-server 4.0.18-log
    MySQL-client 4.0.18

    Error log say:

    Number of processes running now: 0
    040301 14:03:23 mysqld restarted
    040301 14:03:24 InnoDB: Started
    /usr/local/libexec/mysqld: ready for connections.
    Version: '4.0.15' socket: '/tmp/mysql.sock' port: 3306
    It was compiled (mysql) or it was installed from binary package?
    Are u sing mysql with linuxthreads or not?

  10. #10
    Join Date
    Feb 2004
    Location
    Peterburg, Russija
    Posts
    7

    Re: Connecting to MySQL

    MySQL was compilied and installed from the corresponding FreeBSD ports (mysql-server-4.0 and mysql-cli-4.0).

    Linuxthreads are not using.

  11. #11
    Join Date
    Oct 2003
    Location
    Slovakia
    Posts
    482

    Re: Connecting to MySQL

    Originally posted by KolyaA
    MySQL was compilied and installed from the corresponding FreeBSD ports (mysql-server-4.0 and mysql-cli-4.0).

    Linuxthreads are not using.
    I found the same problem but without solution: http://lists.freebsd.org/pipermail/f...er/023808.html

    OK, try download binary package for freebsd from www.mysql.com and try install it. Then copy datafiles from old mysql to the new mysql.
    Try run it and let me know if it is running without problems.

Posting Permissions

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