Skip to content

Database Installation

Dmitry Romanov edited this page Jan 27, 2017 · 9 revisions

##Prerequisites In order to do the steps below one has to set environment variables as it is described in RCDB installation section. RCDB_CONNECTION should be set also (see below).

Lets assume that one wants to install RCDB to the following database:

  • database location: localhost
  • database name: rcdb
  • database user name: rcdb
  • database user password: password

then the connection string should be

mysql://rcdb:password@localhost/rcdb

and

export RCDB_CONNECTION='mysql://rcdb:password@localhost/rcdb'

##Create MySQL database (RCDB is also tested for MariaDB. RCDB should also work with other MySQL forks while it isn't tested)

Create database structure:

cd $RCDB_HOME/sql
mysql -u root -p < schema.mysql.sql

Create user and give privileges:

mysql -u root -p
CREATE USER 'rcdb'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON rcdb.* TO 'rcdb'@'localhost';

Update database to the latest version

RCDB uses Alembic to track and update database version. So after creating db scheme one has to run alembic to upgrade DB to the latest version:

cd $RCDB_HOME
alembic upgrade head

After this the database is of the latest version and is ready to be used