Personal tools
You are here: Home Community Help Center How-tos MySQL DB set up

MySQL DB set up

Out of the box, the RiskAnalytics installer comes with a Derby DB backend; no DB configuration needed. To increase the performance of the backend, one should use a comprehensive database product. We describe how to set up MySQL as a RiskAnalytics backend.

Purpose

The database which comes bundled with PillarOne is mostly useful to test the application or components / models. For operational use of PillarOne, i.e. storing numerous simulation results each of which may contain a couple of hundred thousand of floating point numbers, we recommend using a professional database. This impoves the performance significantly and in multi-user mode also allows additional security.

In the following we describe how to set up MySQL as the back-end for PillarOne. Any other professional database product can be used, as well. Get in touch with us if you want to run it on Oracle, DB2 or whatever.

Because PillarOne uses partitioned tables, MySQL 5.1 or newer is required.

Prerequisities

Riskanalytics (more recent than v0.4) installed.

Download the recent version of the community mysql server and install it. The proposed settings during installation are usually fine.

Step by step

  1. Login to your mysql server
    os-shell> mysql --user=root --password=guess
    If mysql has not been added to the path during the installation, the installation directory has to be selected before entering the login command.
    Hint: If there was a problem setting up the root account during the installation of mysql, the password can be set using mysqladmin -u root password guess
  2. Create a new database instance called 'p1rat'
    mysql> create database p1rat;
  3. Create a new user and set his password
    mysql> create user 'p1rat'@'localhost' identified by 'p1rat';
  4. Enable the new user to access the new database instance
    mysql> grant all on table p1rat.* to 'p1rat'@'localhost';
  5. Grant file access to enable batch uploads
    mysql> grant file on *.* to 'p1rat'@'localhost';
  6. Leave the mysql session
    mysql> exit
  7. Enable partitions and indices on the database to improve runtime
    call grails -Dgrails.env=mysql init-database
  8. Modify the fifth line in RiskAnalytics.cmd in order to use the mysql database. The file is available in the installation sub-directory RiskAnalytics of the RiskAnalytics installation.
    Replace
    call grails -Dgrails.env=standalone runRiskAnalytics
    with
    call grails -Dgrails.env=mysql runRiskAnalytics

Further information

  • Startup environments are defined in 
    • RiskAnalytics/grails-app/conf/Config.groovy and
    • RiskAnalytics/grails-app/conf/DataSource.groovy
  • Any other database product supported by Hibernate may be used.
Document Actions