Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

remote mysql jdbc connection refused

843854Feb 3 2002 — edited Feb 4 2002
hi,
i'm having problems connecting to my MySql server using the jdbc driver. When i give the url as localhost, its fine. but if i change it to the name of the machine or its ip address, it's giving the following error:

java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.socketConnect(Compiled Code)
at java.net.PlainSocketImpl.doConnect(Compiled Code)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:125)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:112)
at java.net.Socket.<init>(Socket.java:269)
at java.net.Socket.<init>(Socket.java:98)
at org.gjt.mm.mysql.MysqlIO.<init>(MysqlIO.java:114)
at org.gjt.mm.mysql.Connection.<init>(Connection.java:229)
at org.gjt.mm.mysql.Driver.connect(Driver.java:126)
at java.sql.DriverManager.getConnection(Compiled Code)
at java.sql.DriverManager.getConnection(DriverManager.java:159)
at DbClient.main(Compiled Code)
SQLException: Cannot connect to MySQL server on 129.130.10.3:3306. Is there a MySQL server running on the machine/port you are trying to connect to? (java.net.ConnectException)
SQLState: 08S01
VendorError: 0
Error Received: java.lang.NullPointerException


The MySql server is running on a Solaris 2.7 sparc machine. Also i was tried connecting to it with telnet and the response was given only when localhost was specified and not with the url of the machine.

Pls help,
Sunil.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 4 2002
Added on Feb 3 2002
2 comments
571 views