OAuth for MyProxy: MySQL Configuration

Scope: client and server, all versions.

This configures a MySQL store. There are several options, but most of them are optional. Generally the schema, tablename and such use the default. Any option prefixed with a * in the table will have its default used. Note that there may be many MySQL stores for a configuration if each of them, e.g. requires different connection information.

Attribute Required? Default Description
username Y N/A The name of the user to use
password Y N/A The password for the user
host N localhost The host. (localhost)
port N 3306 The port for the connection. (3306)
driver N current The JDBC driver
database N The name of the database.
schema N The schema for the database
prefix N (none) An optional prefix for the table.
parameters N (none) An optional extra set of parameters to pass to the JDBC driver. This is of the form key0=value0&key1=value1&key2=value2... Note that each key/value pair is separated with an ampersand. Note that OA4MP does all connections using UTF8 so that parameter is always added.
useSSL N false Try to connect to the database using SSL support. This presumes you have configured the database to use SSL.


The content of the store is specified in one of the content tags.

Getting install scripts.

The latest installation scripts for all versions are listed here: You may just cut and paste them from the file into the command line interface or execute them as scripts. Be sure to read the comments since you may want to customize them to fit your installation.

Example 1.

<config>
   <service name="atmos-physics>
      <mysql username="foo"
          password="bar"
          schema="atmos"
          database="climate"
          useSSL="true"
          parameters="parameters="useJDBCCompliantTimezoneShift=true&amp;useLegacyDatetimeCode=false&amp;serverTimezone=America/Chicago"">
         <transactions/>
      </mysql>
      <!-- other stuff -->
   </service>
</config>
In this example, there is a mysql store for the transactions only which uses the given username and password to connect over SSL. A set of parameters is passed in to fix a bug whereby the system timezone is incorrectly gotten from the operating system, so it must be specifically set for all connections. Note that in the configuration file that the ampersand is written out as &amp;.

Example 2.

The table prefix is optional. It is a string that is prepended to the table in order to give a "poor man's namespace qualification." In the case of MySQL, there is actually no schema support and the schema and database name are considered the same (the database name wins if they are different). The prefix lets you fix that if you need to. For instance if the table name is "myTable" and the prefix is "a" all access is to the table named "a_myTable", so when considering using this you should not exceed total name length requirements. Allowing prefixes allows for multiple tables to reside in the same database. One plus with this is that it allows for having multiple OA4MP clients and servers use a single database if that is all that is available.

<config>
   <service name="my-config" address="http://chem.bigstate.edu/grid/oa4mp"
      <mysql username="chem-server" password="fnord" prefix="xup" database="chem">
         <transactions/>
      </mysql>
      <!-- other stuff -->
      <mysql username="chem-client-admin"
                password="otherfnord"
                prefix="xac"
                database="chem"
                useSSL="true">
         <client/>
         <clientApprovals/>
      </mysql>
   <!-- other stuff -->
   </service>
</config>

Creates a server which allows for accessing the tables under two different accounts. Note the use of prefixes. The first has a prefix of "chem" (so the fully-qualified table name is chem.xup_transactions) and the second has a prefix of "xac", so the tables there are chem.xac_clients and chem.xac_clientApprovals. The second has SSL enabled for its connections. This allows administrators to have a more fine-grained approach to access.

A Client Example

In the next example, a fully functional MySQL client asset store is configured.

<config>
    <client name="my-cfg">
       <mysql username="sinead"
          password="eringobragh"
          database="oa4mp"
          prefix="client">
          <assetStore/>
       </mysql>
       <!-- other stuff -->
    </client>
</config>
which stores all the assets created by the client in the database named "oa4mp" and in the table named "client_assets".

Last modified 11/20/19.
©2000-2013 Board of Trustees of the University of Illinois.