Re: CayenneModeler's Reengineer + MySQL server

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Nov 23 2004 - 09:36:32 EST

  • Next message: Cris Daniluk: "RE: CayenneModeler's Reengineer + MySQL server"

    Hi Alex,

    This looks like a low-level connection error. I don't remember all mysqld
    options, but "--socket=/tmp/cycorp.sock" looks suspicious - Java JDBC
    applications can't use UNIX sockets, so you need to make sure that TCP
    connections are indeed enabled... E.g.:

    1. check that there is indeed a daemon on this port:

    # netstat -an |grep 3306

    2. check that it is listening on a loopback interface:

    # telnet 127.0.0.1 3306

    Andrus

    > I encountered this very very awkward error..
    >
    > Hopefully the following give enough information:
    >
    > 1) I run MySQL Server
    > agwibow..ozart:~ $ sudo /usr/bin/mysqld_safe
    > --port=3306 --socket=/tmp/cycorp.sock
    > Starting mysqld daemon with databases from
    > /var/lib/mysql
    >
    > 2) and to verify that it is running:
    >
    > agwibow..ozart:~ $ mysql -u root --port=3306
    > --socket=/tmp/cycorp.sock -p
    > Enter password:
    > Welcome to the MySQL monitor. Commands end with ; or
    > \g.
    > Your MySQL connection id is 2 to server version:
    > 4.0.20-log
    >
    > Type 'help;' or '\h' for help. Type '\c' to clear the
    > buffer.
    >
    > mysql>
    >
    >
    > So at this point i'm certain that mysql is running on
    > port 3306.
    >
    > agwibow..ozart:~ $ echo $CLASSPATH
    > .:/home/agwibowo/java_lib/mysql-connector-java-3.0.9-stable/mysql-connector-java-3.0.11-stable-bin.jar:/home/agwibowo/java_lib/cayenne-1.1RC2/cayenne.jar
    >
    >
    > Now I run CayenneModeller..
    >
    > I give:
    >
    > JDBC Driver: com.mysql.jdbc.Driver
    > DB URL: jdbc:mysql://127.0.0.1:3306/netoffice
    > User name: root
    > Password : blablabla
    >
    > When i do the reengineer, it says "Unable to connect
    > to any hosts due to exception:
    > java.net.ConnectException: Connection refused"
    >
    > I have tried with different MySQL drivers, including
    > mysql-connector-java-3.0.11-stable-bin.jar
    > and
    > mysql-connector-java-3.0.15-ga-bin.jar
    >
    > Both gives the same error message. The 15-ga however,
    > also gives "STACK TRACE", with a lot of exception.
    >
    > I failed to understand what is causing this, since
    > clearly MySQL is running on port 3306, and I've given
    > all priviles to anybody on anyhost to access any
    > database.
    >
    > Could anyone help, please? I've tried debugging this
    > for hours...
    >
    >
    >
    > Thanks in advance!
    >
    > I'm running MySQL that comes with Ubuntu Linux, if
    > that helps.
    >
    >
    > Best regards,
    >
    >
    > Alex.



    This archive was generated by hypermail 2.0.0 : Tue Nov 23 2004 - 09:36:34 EST