Hi All,
I'm new Java and Mysql Programmer and have a big problem to remote connect Mysql Server by following Setting:
1. Server Computer : Linux 9.0 with LAN IP : 10.2.112.100 / 255.255.255.0
2. Router Setting LAN IP MAP with True IP : 218.111.231.22 /255.255.255.240
3. Server Installed : MySQL, Java SDK 1.4 and JRE 1.4 with Java-web Start JNLP
Problem :
1. We can access MySQL internal with Client in LAN IP
2. Once i came home and remote connect by True IP the following message occur.
My Connect Message -----------------------------------------------
Connection c = DriverManager.getConnection(
"jdbc:mysql://218.111.231.22:3306/IOP?user=mysql&password=admin");
---------------------------------------------------------------------
Error Message -----------------------------------------------------
SQLException Status : SQLException: Unable to connect to any hosts due to exception: java.net.ConnectException: Connection refused: connect
** BEGIN NESTED EXCEPTION **
java.net.ConnectException
MESSAGE: Connection refused: connect
STACKTRACE:
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at com.mysql.jdbc.StandardSocketFactory.connect(Stand ardSocketFactory.java:121)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:219)
at com.mysql.jdbc.Connection.createNewIO(Connection.j ava:1771)
at com.mysql.jdbc.Connection.<init>(Connection.java:4 40)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.java:400)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
...........
** END NESTED EXCEPTION **
SQLStatus : SQLState: 08S01
Vendor Status : VendorError: 0
----------------------------------------------------------------------------
Thanks
Sanki Poon