blob: c5043adcf13376699ce871b5643ede9911507e6c [file] [log] [blame]
Yulia Portnova0f991192015-04-24 16:56:52 +03001#!/bin/bash
2# install and configure mysql
3DATABASE_PASSWORD=wally
4DATBASE_USER=root
5DB_NAME=tpcc
6
7# not prompting db password
8debconf-set-selections <<MYSQL_PRESEED
9mysql-server mysql-server/root_password password $DATABASE_PASSWORD
10mysql-server mysql-server/root_password_again password $DATABASE_PASSWORD
11mysql-server mysql-server/start_on_boot boolean true
12MYSQL_PRESEED
13
14apt-get install -y mysql-server
15apt-get install -y libmysqld-dev
16apt-get install -y make
17
18# disable mysql profile in apparmor
19sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
20sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
21
22# allows us not to access mysql without specifying password
23cat <<EOF >$HOME/.my.cnf
24[client]
25user=$DATABASE_USER
26password=$DATABASE_PASSWORD
27host=$DATABASE_HOST
28EOF
29
30cd ~
31apt-get install bzr
32bzr branch lp:~percona-dev/perconatools/tpcc-mysql
33cd tpcc-mysql/src
34make
35
36cd ..
37mysql -e "CREATE DATABASE $DB_NAME;"
38mysql "$DB_NAME" < create_table.sql
39mysql "$DB_NAME" < add_fkey_idx.sql
40
41./tpcc_load localhost "$DB_NAME" "$DATBASE_USER" "$DATABASE_PASSWORD" 20