Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#39 connection problem

open
nobody
None
5
2002-07-10
2002-07-10
Zee
No

I tried to run a servlet connection to Mysql using
mm.mysql and I got this error:

SQL Problem : Cannot connect to MySQL server on
HostIP:3306. Is there a MySQL server running on the
machine/port you are trying to connect to? (java.net
.NoRouteToHostException)
SQL State : 08S01
Vendor Error: 0

I tried to connect to to Mysql using the same
username and password and it was successful.

Here is the code:

String connectionURL
= "jdbc:mysql://localhost:3306/test";
Connection connection = null;
Statement statement = null;
ResultSet resultSet = null;
try {
Class.forName
("org.gjt.mm.mysql.Driver").newInstance();
connection =
DriverManager.getConnection(connectionURL,
"servlet", "yowza");

Please help!

Discussion

  • George Smith
    George Smith
    2002-07-26

    Logged In: YES
    user_id=271280

    Please read my comments on "57944 Server Configuration
    denies access" it is the same resolution.....

     
  • Logged In: NO

    Communication