[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tomcat-user
Subject:    RE: Tomcat and MySQL
From:       Scott Stewart <SStewart () csky ! com>
Date:       2003-07-31 19:27:14
[Download RAW message or body]

Look closely at your URL - it is malformed.

it should read:
connectionURL="jdbc:mysql://localhost/authority?user=leeson&password=xxxx"

Thanks,

Scott Stewart

-----Original Message-----
From: engp0510 [mailto:engp0510@nus.edu.sg]
Sent: Thursday, July 31, 2003 11:48 AM
To: tomcat-user@jakarta.apache.org
Subject: Tomcat and MySQL


Hi,
 I am using Tomcat 4.0 and MySQL 4.0.14 on WIn2K Professional.
In Server.XML of Tomcat, I use:

 <Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99"
             driverName="org.gjt.mm.mysql.Driver"

connectionURL="jdbc:mysql://localhost/authority?user=leeson;password=xxxx"
              userTable="users" userNameCol="user_name"
userCredCol="user_pass"
          userRoleTable="user_roles" roleNameCol="role_name" />

In MySQL, I set all user must access database with password and grant user
'leeson' with all privileges. I can use leeson and password to log into
MySQL. But when I start tomcat-standalone, there is always  :

Catalina.start: LifecycleException:  Exception opening database connection:
java.sql.SQLException: Invalid authorizatio
n specification: Access denied for user: 'leeson;password@localhost' (Using
password: NO)
LifecycleException:  Exception opening database connection:
java.sql.SQLException: Invalid authorization specification:
 Access denied for user: 'leeson;password@localhost' (Using password: NO)
        at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:615)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1108)
        at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:307)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:388)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:505)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:776)
        at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
        at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:218)
----- Root Cause -----
java.sql.SQLException: Invalid authorization specification: Access denied
for user: 'leeson;password@localhost' (Using p
assword: NO)
        at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:659)
        at com.mysql.jdbc.Connection.createNewIO(Connection.java:1562)
        at com.mysql.jdbc.Connection.<init>(Connection.java:491)
        at
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:346)
        at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:548)
        at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:613)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1108)
        at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:307)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:388)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:505)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:776)
        at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
        at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:218)

Can anyone help me?


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic