]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STORAGE/setupStorageDatabase.sh
Fix
[u/mrichter/AliRoot.git] / STORAGE / setupStorageDatabase.sh
CommitLineData
5eb34a26 1#!/bin/bash
2HOST="localhost" # IP of machine on which mysql database is located
3PORT="5055"
4DATABASE="storage"
5USER="storage"
6PASS="storage123"
7TABLE="events"
8STORAGE_PATH="/local/home/edis/storedFiles"
9MAX_SIZE="5000000"
10MAX_OCCUPATION="80"
11REMOVE_PERCENT="60"
12EVENTS_IN_FILE="7"
13EVENT_SERVER="localhost" # IP of machine running alieventserver
14STORAGE_SERVER="localhost" # IP of machine running alistorage
15mysql -u root -pdaq -e "create database if not exists $DATABASE;"
16mysql -u root -pdaq -e "grant ALL PRIVILEGES on $DATABASE.* to '$USER'@'$HOST' identified by '$PASS';"
17mysql -u root -pdaq -e "use $DATABASE;"
18mysql -u root -pdaq -e "CREATE TABLE IF NOT EXISTS $DATABASE.$TABLE(\
19run_number int(6) NOT NULL,\
20event_number int(6) NOT NULL,\
21system text(7) DEFAULT NULL,\
22multiplicity int(5) DEFAULT NULL,\
23permanent tinyint(1) DEFAULT NULL,\
24file_path text(100) DEFAULT NULL,\
25PRIMARY KEY(run_number,event_number));"
26
27echo "-----------------------------"
28echo "Databases successfuly created"
29echo "-----------------------------"
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51