Skip to content
Tapper team edited this page Mar 1, 2016 · 17 revisions

Overview

This is a follow-up to HelloWorld. Prepare that first and then come back here.

The example config ~/.tapper/tapper.cfg already comes with commented out configuration for using MySQL. Here we

  1. prepare a MySQL database,

  2. modify Tapper config to point to it, and

  3. re-run tapper init to initialize the databases with tables

Prepare MySQL

Install MySQL

  $ sudo apt-get install mysql-server-5.6 mysql-client-5.6

Optional: drop existing Tapper database

Careful!

If you want to delete an existing database, then do that:

  $ mysql -u root -p
  $ mysql> drop database tapper;

Create Tapper database

  $ mysql -u root -p
  $ mysql> create database if not exists tapper;
    mysql> create user 'tapper'@'localhost' identified by 'verysecret';
    mysql> grant all privileges on tapper.* to 'tapper'@'localhost';
    mysql> flush privileges;
    mysql> quit;

Reconfigure Tapper

Edit ~/.tapper/tapper.cfg in 2 places:

Part 1 - configure testrun database

Find this piece:

database:
  TestrunDB:
    dsn: dbi:SQLite:dbname=...
    #dsn: DBI:mysql:database=tapper
    #user: tapper
    #password: verysecret

and modify it to look like this:

database:
  TestrunDB:
    #dsn: dbi:SQLite:dbname=...
    dsn: DBI:mysql:database=tapper
    user: tapper
    password: verysecret

Part 2 - configure benchmark database

Find this piece:

benchmarkanything:
  backend: local
  backends:
    http:
      base_url: http://localhost:7359
  storage:
    backend:
      sql:
        # --- SQLite ---
        dsn: dbi:SQLite:/home/ss5/.tapper/benchmarkanything.sqlite
        # --- mysql (example) ---
        #dsn: DBI:mysql:database=benchmarkanything
        #user: benchmarker
        #password: secret

and modify it to look like this:

benchmarkanything:
  backend: local
  backends:
    http:
      base_url: http://localhost:7359
  storage:
    backend:
      sql:
        # --- SQLite ---
        #dsn: dbi:SQLite:/home/ss5/.tapper/benchmarkanything.sqlite
        # --- mysql (example) ---
        dsn: DBI:mysql:database=benchmarkanything
        user: benchmarker
        password: secret

Re-initialize Tapper with the new databases

Careful!

  $ tapper init --defaults
  [... many lines with "SKIP...already exists"]
  REALLY DROP AND RE-CREATE DATABASE TABLES [DBI:mysql:database=tapper] (y/N)? y
  REALLY DROP AND RE-CREATE DATABASE TABLES [DBI:mysql:database=benchmarkanything] (y/N): y

Clean up

You can now either throw away the benchmarkanything.sqlite and testrundb.sqlite files in ~/.tapper/, or try to migrate their content - which is unfortunately a bit more complicated and not documented here.

Quick Links

About

Release changelogs

  • 5.0 2016-03 "Max Headroom"
  • 4.1 2012-10 "Cagney&Lacey"
  • 4.0 2012-05 "Columbo"
  • 3.0 2011-03 - public release
  • 2.0 2008-12 "Lastwagenkrieg"
  • 1.0 2007-12 - internal prototype

Development

Clone this wiki locally