Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MySQL JDBC Fails to connect but MySQL Query Browser works....

8 views
Skip to first unread message

RunZicoRun

unread,
May 15, 2005, 4:37:46 PM5/15/05
to

HI;

I have MySQL running on a mandrake Linux box. I installed MySQL
Query Browser client. I added a user to my MySQL called zico. I was
able to connect from MySQL Query Browser to the database and run a
query. When I try to connnect to the database using "java ExecuteSQL -d
org.gjt.mm.mysql.Driver -p elf -u zico jdbc:mysql://192.168.2.3/test",
it doesn't work. Does jdbc (Connector J)has a verbose debugging
options? my /etc/my.cnf file is empty and mysqld didn't start with the
skip-networking option. I can see everything fine with MySql Query
Browser. How come this is not working? Thanks for any help.


STACKTRACE:

java.net.SocketException: java.net.ConnectException: Connection
refused: connect

at
com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.ja
va:151)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:280)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1774)
at com.mysql.jdbc.Connection.<init>(Connection.java:437)
at
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java
:268)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at ExecuteSQL.main(ExecuteSQL.java:47)


** END NESTED EXCEPTION **

Mark Matthews

unread,
May 15, 2005, 5:51:40 PM5/15/05
to RunZicoRun
RunZicoRun wrote:
>
> HI;
>
> I have MySQL running on a mandrake Linux box. I installed MySQL
> Query Browser client. I added a user to my MySQL called zico. I was
> able to connect from MySQL Query Browser to the database and run a
> query. When I try to connnect to the database using "java ExecuteSQL -d
> org.gjt.mm.mysql.Driver -p elf -u zico jdbc:mysql://192.168.2.3/test",
> it doesn't work. Does jdbc (Connector J)has a verbose debugging
> options? my /etc/my.cnf file is empty and mysqld didn't start with the
> skip-networking option. I can see everything fine with MySql Query
> Browser. How come this is not working? Thanks for any help.

What happens if you try to telnet to 192.168.2.3 port 3306? If it
connects, then there's something going on with the JDBC driver. My guess
is that it _won't_ connect and your database server isn't listening to
TCP/IP on that port, or it's firewalled somehow.

-Mark

--
Mark Matthews
MySQL AB, Software Development Manager - Connectivity
www.mysql.com

RunZicoRun

unread,
May 15, 2005, 7:33:30 PM5/15/05
to
I'm running my jdbc and MySQL Query Browser client on windows XP. MySQL
Query Browser works. MySQL Query Browser is able to connect to my linux
box. There are no firewalls. I can telnet to that port, but I can't run
queries on it. It needs a special handshake.

Thanks for the info. The connection is there but jbdc is not working.

Hany

RunZicoRun

unread,
May 15, 2005, 9:07:19 PM5/15/05
to

I got the connection to work by downloading an older version of the
JDBC 3.0.16 I believe.

Thanks.

0 new messages