Skip to content

Database Installation

Dmitry Romanov edited this page Mar 14, 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/python
python 

Create a user and give it privileges:

mysql -u root -p

note that by default for MariaDB one have to be root to login mysql as root. So it is something like sudo mysql -u root -p for MariaDB

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. 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