An additional note on the & character in the connection URL for MySQL...

XML syntax is going to require the & character be encoded as & so the 
real URL should loo something like:

jdbc:mysql://localhost/authority?user=test&password=test

This is how I had to write it in my server.xml file.  Works like a charm.  
The encoding does not have to be done in regular JSP or java files.  Only XML 
files like server.xml require this.  Everywhere else, just use an & character.

--David Smith

On Thursday 01 November 2001 11:16 am, you wrote:
> At 1:51 PM +0100 11/1/01, Andrius wrote:
> >Hello,
> >     What's the correct MySQL jdbc connection url? I'm trying to setup
> >jdbcRealm on tomcat 4.0.1,
> >     and using this url pattern :
> >connectionURL="jdbc:mysql://localhost/authority?user=test;password=test"
> >    but it goes wrong - it says "Invalid authorization exception: Access
> >denied for user: 'test;password@host'.
> >     I've configured server side permissions properly (mySQL accepts using
> >another client). thanx for any response.
> >
> >obj.
>
> Only very old versions of the MM.MySQL driver accept ; as a parameter
> separator character.  Current versions accept only & as the separator.
>
> If any of the Tomcap developers happen to read this:
>
> Note that the server.xml file that ships with Tomcat 4.0.1 (and probably
> earlier versions as well) is mistaken on this point.  The relevant
> section looks
> like this:
>
>        <!--
>        <Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99"
>               driverName="org.gjt.mm.mysql.Driver"
>
> connectionURL="jdbc:mysql://localhost/authority?user=test;password=test"
>                userTable="users" userNameCol="user_name"
> userCredCol="user_pass" userRoleTable="user_roles" roleNameCol="role_name"
> />
>        -->
>
> The connectionURL line should be fixed to say this instead:
>
> connectionURL="jdbc:mysql://localhost/authority?user=test&password=test"
>
> --
> To unsubscribe:   <mailto:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to