tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SIMONIN Alexandre <>
Subject *** HELP *** mySQL connectivity problems
Date Mon, 30 Jul 2001 12:41:10 GMT

I'm running mySQL 2.0.4 and Tomcat 4.0 on Cobalt/Linux. 

When trying to get a connection to the database, I got the following error
(the code is provided below - exact id and password replaced for

Step 1 : Class.forName(""); OK
Step 2 :
assword=myPwd"); *** FAILURE ***
     SQLException: Cannot connect to MySQL server on Is there a MySQL server running on the
machine/port you are
     trying to connect to? (
     SQLState: 08S01
     VendorError: 0

Few comments:
1/ the mySQL server's site address is OK (not the localhost)
2/ the mySQL server's port is OK
3/ the table name is OK
4/ the userID is OK
5/ the password is OK
6/ the connection looks fine through phpMyAdmin
7/ I get the same when doing the same
request without the userID and password
6/ I got a (which seems normal to me) when trying
to call the server as if it was local to my machine, i.e.:

Any suggestion?

The code:

    try {
      Class.forName("");   // this or <the
same>.newInstance() does the same
      System.out.println("Step1: Class.forName(\"\"):
    catch (Exception e) {
      System.out.println("Class.forName(\"\"): ***
FAILURE ***");

    Connection myConn = null;

    try {
      myConn =
      System.out.println("Step 2:
password=myPwd\"): OK");
    catch (SQLException e) {
      System.out.println("Step 2:
password=myPwd\"): *** FAILURE ***");
     System.out.println(" SQLException: "+e.getMessage());
     System.out.println(" SQLState: "+e.getSQLState());
     System.out.println(" VendorError: "+e.getErrorCode());

View raw message