You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Paul DuBois <pa...@snake.net> on 2001/11/01 17:16:57 UTC

Re: MySQL jdbc connection url [ + server.xml bug]

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:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: MySQL jdbc connection url [ + server.xml bug]

Posted by Paul DuBois <pa...@snake.net>.
At 11:48 AM -0500 11/1/01, David Smith wrote:
>An additional note on the & character in the connection URL for MySQL...
>
>XML syntax is going to require the & character be encoded as &amp; so the
>real URL should loo something like:
>
>jdbc:mysql://localhost/authority?user=test&amp;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

Quite right.  I neglected to mention that.  Thanks for pointing it iout.

>
>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:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: MySQL jdbc connection url [ + server.xml bug]

Posted by David Smith <dn...@cornell.edu>.
An additional note on the & character in the connection URL for MySQL...

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

jdbc:mysql://localhost/authority?user=test&amp;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:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>