-
Notifications
You must be signed in to change notification settings - Fork 2
SwitchingToMySQL
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
-
prepare a MySQL database,
-
modify Tapper config to point to it, and
-
re-run
tapper initto initialize the databases with tables
$ sudo apt-get install mysql-server-5.6 mysql-client-5.6Add these lines into your /etc/mysql/my.cnf under the [mysqld] group:
[mysqld]
innodb_large_prefix = on
innodb_file_per_table = on
innodb_file_format = Barracudaand restart mysql, e.g., with:
$ sudo /etc/init.d/mysql restartCareful!
If you want to delete an existing database, then do that:
$ mysql -u root -p
$ mysql> drop database testrundb;
$ mysql> drop database benchmarkanything; $ mysql -u root -p
$ mysql> create database if not exists testrundb CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql> grant all on `testrundb`.* to `tapper`@localhost identified by 'verysecret';
mysql> quit; $ mysql -u root -p
$ mysql> create database if not exists benchmarkanything CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql> grant all on `benchmarkanything`.* to `benchmarker`@localhost identified by 'secret';
mysql> quit;Edit ~/.tapper/tapper.cfg in 2 places:
Find this piece:
database:
TestrunDB:
dsn: dbi:SQLite:dbname=...
#dsn: DBI:mysql:database=testrundb
#user: tapper
#password: verysecretand modify it to look like this:
database:
TestrunDB:
#dsn: dbi:SQLite:dbname=...
dsn: DBI:mysql:database=testrundb
user: tapper
password: verysecretFind 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: secretand 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: secretCareful!
$ tapper init --default
[... many lines with "SKIP...already exists"]
REALLY DROP AND RE-CREATE DATABASE TABLES [DBI:mysql:database=testrundb] (y/N)? y
REALLY DROP AND RE-CREATE DATABASE TABLES [DBI:mysql:database=benchmarkanything] (y/N): yYou 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.
- About
- Deployment
- Hello World - easiest start