HN7JDKV3DG4KYJHD6YWWRWGCNLUJQFI7EHRQBXZXWOM4QFGH275AC Hydra stores its results in a PostgreSQL database. To setup a database with <emphasis>hydra</emphasis> as database name and username, issue the following commands:
Hydra stores its results in a database, which can be aPostgreSQL or SQLite database. The latter is easier tosetup, but the former scales better.</para><para>To setup a PostgreSQLdatabase with <emphasis>hydra</emphasis> as database nameand user name, issue the following commands:
Note that <emphasis>$prefix</emphasis> is the location of Hydra in the nix store.
Note that <emphasis>$prefix</emphasis> is the location ofHydra in the nix store.</para><para>For SQLite, the following command is all it takes tocreate the database:<screen>cat $prefix/share/hydra/sql/hydra-sqlite.sql | sqlite3 /path/to/hydra.sqlite</screen>
echo "INSERT INTO UserRoles(userName, role) values('root', 'admin');" | psql hydra</screen>
echo "INSERT INTO UserRoles(userName, role) values('root', 'admin');" | psql hydra</screen>For SQLite the same commands can be used, with<command>psql hydra</command> replaced by<command>sqlite3 /path/to/hydra.sqlite</command>.</para>
Hydra uses an environment variable to know which database should be used, and a variable which point to a location that holds some state. To set thesevariables, add the following to the <emphasis>.profile</emphasis> of the user running the Hydra services.
<para>Hydra uses an environment variable to know which databaseshould be used, and a variable which point to a locationthat holds some state. To set these variables for aPostgreSQL database, add the following to the<filename>.profile</filename> of the user running theHydra services.
Make sure that the <emphasis>HYDRA_DATA</emphasis> directory exists and is writable for the user which will run the Hydra services.
Make sure that the <emphasis>HYDRA_DATA</emphasis>directory exists and is writable for the user which willrun the Hydra services. For a SQLite database, the<varname>HYDRA_DBI</varname> should be set to somethinglike <literal>dbi:SQLite:/path/to/hydra.sqlite</literal>