OA4MP: Maria DB Configuration

Scope: client and server, all versions.

This configures a Maria DB 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 Maria DB 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: Since Maria DB's SQL is virtually identical to MySQL, the same scripts work for both databases. 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>
      <mariadb username="foo"
          password="bar"
          schema="atmos"
          database="climate"
          useSSL="true">
         <transactions/>
      </mariadb>
      <!-- other stuff -->
   </service>
</config>
In this example, there is a Maria DB store for the transactions only which uses the given username and password to connect over SSL.

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 Maria DB (and MySQL, for that matter), 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"
      <mariadb username="chem-server" password="fnord" prefix="xup" database="chem">
         <transactions/>
      </mariadb>
      <!-- other stuff -->
      <mariadb username="chem-client-admin"
                password="otherfnord"
                prefix="xac"
                database="chem"
                useSSL="true">
         <client/>
         <clientApprovals/>
      </mariadb>
   <!-- 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 Maria DB client asset store is configured.

<config>
    <client name="my-cfg">
       <mariadb username="sinead"
          password="eringobragh"
          database="oa4mp"
          prefix="client">
          <assetStore/>
       </mariadb>
       <!-- 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".