summaryrefslogtreecommitdiffstats
path: root/rubbos/rubbos_scripts/1-1-1/scripts/MYSQL1_configure.sh
blob: 01a718d9240a21d836e03f5890213bb3870daa08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash

cd /bottlenecks/rubbos/rubbos_scripts/1-1-1
source set_bottlenecks_rubbos_env.sh

echo "CONFIGURING MYSQL on $HOSTNAME"

cd $MYSQL_HOME
chown -R mysql:mysql ./
cp support-files/my-medium.cnf /etc/my.cnf
#bin/mysqld_safe --user=$BOTTLENECKS_USER &
bin/mysqld_safe&
sleep 10
#bin/mysqladmin -u root password 'new-password'
cp support-files/mysql.server /etc/init.d/mysql.server
/etc/init.d/mysql.server status

if [ -f "/usr/local/bin/mysql" ]; then
rm -rf /usr/local/bin/mysql
fi

ln -s $MYSQL_HOME/bin/mysql /usr/local/bin/mysql

sleep 20

cat << EOF | mysql -uroot

CREATE DATABASE rubbos;

GRANT ALL PRIVILEGES ON rubbos.* TO 'rubbos'@'%' \
    IDENTIFIED BY 'rubbos';
    flush privileges;
GRANT ALL PRIVILEGES ON rubbos.* TO 'rubbos'@'localhost' \
    IDENTIFIED BY 'rubbos';
    flush privileges;
EOF

tar xzf /tmp/$RUBBOS_DATA_TARBALL
mysql -uroot rubbos < $RUBBOS_DATA_SQL
rm $RUBBOS_DATA_SQL

echo "DONE CONFIGURING MYSQL on $HOSTNAME"