| View previous topic :: View next topic |
| Author |
Message |
RunZicoRun Guest
|
Posted: Sun May 15, 2005 8:37 pm Post subject: MySQL JDBC Fails to connect but MySQL Query Browser works... |
|
|
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 **
|
|
| Back to top |
|
 |
Mark Matthews Guest
|
Posted: Sun May 15, 2005 9:51 pm Post subject: Re: MySQL JDBC Fails to connect but MySQL Query Browser work |
|
|
RunZicoRun wrote:
| Quote: |
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
|
|
| Back to top |
|
 |
RunZicoRun Guest
|
Posted: Sun May 15, 2005 11:33 pm Post subject: Re: MySQL JDBC Fails to connect but MySQL Query Browser work |
|
|
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
|
|
| Back to top |
|
 |
RunZicoRun Guest
|
Posted: Mon May 16, 2005 1:07 am Post subject: Re: MySQL JDBC Fails to connect but MySQL Query Browser work |
|
|
I got the connection to work by downloading an older version of the
JDBC 3.0.16 I believe.
Thanks.
|
|
| Back to top |
|
 |
|