Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

HPS uses a conditions database conditions backend which is accessible through the DatabaseConditionsManager.

...

No username or password is required when connecting locally in this way.

Creating a Local SQLite Database

In order to create a local SQLite database, you will need to create a snapshot of the MySQL database and convert it to a SQLite db file.   

This converter script can be used to produce the db file.

It can be downloaded using these commands:

Code Block
titleMySQL Conversion Script
  wget https://raw.githubusercontent.com/dumblob/mysql2sqlite/master/mysql2sqlite
  chmod +x mysql2sqlite

You can create a dump of the current conditions database using this command: 

Code Block
titleCreating a Database Dump
mysqldump --skip-extended-insert --compact -u hpsuser --password=darkphoton -h hpsdb.jlab.org  --lock-tables=false hps_conditions > hps_conditions.mysql

Now, you can load it into SQLite as follows:

Code Block
titleLoading Dump into SQLite
  mysql2sqlite hps_conditions.mysql | sqlite3 hps_conditions.db

You should have an up to date copy of the master conditions database locally, now.

Configuring Detector Conditions for a Job

...