AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

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

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases
View previous topic :: View next topic  
Author Message
RunZicoRun
Guest





PostPosted: Sun May 15, 2005 8:37 pm    Post subject: MySQL JDBC Fails to connect but MySQL Query Browser works... Reply with 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.


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





PostPosted: Sun May 15, 2005 9:51 pm    Post subject: Re: MySQL JDBC Fails to connect but MySQL Query Browser work Reply with quote



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





PostPosted: Sun May 15, 2005 11:33 pm    Post subject: Re: MySQL JDBC Fails to connect but MySQL Query Browser work Reply with quote



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





PostPosted: Mon May 16, 2005 1:07 am    Post subject: Re: MySQL JDBC Fails to connect but MySQL Query Browser work Reply with quote


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

Thanks.

Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.