You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Yves Sablonier <yv...@sablonier.ch> on 2002/09/26 03:43:14 UTC

JDBCStore

Need some help.

I am trying to use 
<Store className="org.apache.catalina.session.JDBCStore" 
driverName="com.mysql.jdbc.Driver" 
connectionURL="jdbc:mysql://localhost:3306/tomcatsessions?user=username;password=password" 

etc. in my <Context> of a WebApp under Tomcat 4.0.1

JDBCStore can not connect to my MySQL-Database with this connectionUrl.
I get '@localhost' access denied. It seems like the URL above will not
work with user/password. I had the same Problem with <Realm> but there
is a "ConnectionName" and "ConnectionPassword". This works fine with
<Realm>. Why is the usage of the connnection attributes different in <Store>?

Does anybody know why this URL is not working?

Thanks, Yves

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JDBCStore

Posted by Yves Sablonier <yv...@sablonier.ch>.
Configuration of mysql is ok. I can connect in Netbeans IDE with a
String like
jdbc:mysql://localhost:3306/tomcatsessions?user=username&password=password but

Here I use "&" instead of ";" in the IDE. That works fine. But when I am
using this String in server.xml I get parsing errors because of the "&".
So I tried also "&amp;". I get the same error in all cases:

During init of JDBCStore there is following error:
JDBCStore[]: The database connetion is null or was found to be closed.
Trying to reopen it.

On any action with jsp I get:
JDBCStore[]: SQL Error java.sql.SQLException: General Error: Access
denied dor user: '@localhost' to database 'tomcatsessions'

I had the same errors with ";" in <Realm> configuration. So I use there
connectionName and connectionPassword and <Realm> works!

I need some further hints to solve this problem.

Still: Why are org.apache.catalina.JDBCStore and
org.apache.calalina.JDBCRealm using different connection attributes?

Thanks- Yves

Brad Plies wrote:
> 
> Sounds like a mysql config error.
> try a: GRANT ALL ON <dbname> TO <username>@localhost
> GRANT ALL ON <dbname> TO <username>@'%'
> 
> Make sure the password you're using for the Connection
> is correct too.  Restart MySQL to flush the
> priveleges.
> 
> That's my best recommendation, hope it helps!
> 
> --- Yves Sablonier <yv...@sablonier.ch> wrote:
> > Need some help.
> >
> > I am trying to use
> > <Store
> > className="org.apache.catalina.session.JDBCStore"
> > driverName="com.mysql.jdbc.Driver"
> >
> connectionURL="jdbc:mysql://localhost:3306/tomcatsessions?user=username;password=password"
> >
> >
> > etc. in my <Context> of a WebApp under Tomcat 4.0.1
> >
> > JDBCStore can not connect to my MySQL-Database with
> > this connectionUrl.
> > I get '@localhost' access denied. It seems like the
> > URL above will not
> > work with user/password. I had the same Problem with
> > <Realm> but there
> > is a "ConnectionName" and "ConnectionPassword". This
> > works fine with
> > <Realm>. Why is the usage of the connnection
> > attributes different in <Store>?
> >
> > Does anybody know why this URL is not working?
> >
> > Thanks, Yves
> >
> > --
> > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
> 
> __________________________________________________
> Do you Yahoo!?
> New DSL Internet Access from SBC & Yahoo!
> http://sbc.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JDBCStore

Posted by Brad Plies <pl...@yahoo.com>.
Sounds like a mysql config error.
try a: GRANT ALL ON <dbname> TO <username>@localhost
GRANT ALL ON <dbname> TO <username>@'%'

Make sure the password you're using for the Connection
is correct too.  Restart MySQL to flush the
priveleges.

That's my best recommendation, hope it helps!

--- Yves Sablonier <yv...@sablonier.ch> wrote:
> Need some help.
> 
> I am trying to use 
> <Store
> className="org.apache.catalina.session.JDBCStore" 
> driverName="com.mysql.jdbc.Driver" 
>
connectionURL="jdbc:mysql://localhost:3306/tomcatsessions?user=username;password=password"
> 
> 
> etc. in my <Context> of a WebApp under Tomcat 4.0.1
> 
> JDBCStore can not connect to my MySQL-Database with
> this connectionUrl.
> I get '@localhost' access denied. It seems like the
> URL above will not
> work with user/password. I had the same Problem with
> <Realm> but there
> is a "ConnectionName" and "ConnectionPassword". This
> works fine with
> <Realm>. Why is the usage of the connnection
> attributes different in <Store>?
> 
> Does anybody know why this URL is not working?
> 
> Thanks, Yves
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>