Are you sure that the database is at localhost:3306/test 
Just make sure that the remote linux server has a MYSQL server running
....    


-----Original Message-----
From: Frank Burns [mailto:[EMAIL PROTECTED] 
Sent: 14 May 2007 19:34
To: users@tomcat.apache.org
Subject: Problems with JDBCRealm and mysql ...

I am successfully running a local web application on Windows XP, using
Tomcat 5.5.20, and a JDBCRealm for the application that accesses two
simple
tables (users and user_roles) on a local mysql database.

However, when I try to run the identical set-up on a remote linux server
I
get database connectivity problems. A sample logging error message is:

    ERROR 14 May 07 12:44:54 - Exception opening database connection
    java.sql.SQLException: com.mysql.jdbc.Driver

I can connect to the database and its tables, using the
user/password/database details in the server.xml JDBCRealm
specification, as
shown below.

So why can't Tomcat?

Here is an excerpt from the server.xml on the remote linux machine.

      <Host name="localhost" appBase="webapps"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">

        <Context path="/userroleadmin"
docBase="/opt/tomcat5/webapps/userroleadmin" debug="99">
            <Realm className="org.apache.catalina.realm.JDBCRealm"
                   driverName="com.mysql.jdbc.Driver"
                      connectionURL="jdbc:mysql://localhost:3306/test"
                   connectionName="frank" connectionPassword="burns"
                      userTable="users" userNameCol="username"
userCredCol="password"
                      userRoleTable="user_roles" roleNameCol="role" />
            />
        </Context>

Thanks,

Frank Burns.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to