aboutsummaryrefslogtreecommitdiffstats
path: root/docker/instance_run.sh
blob: 6338e9d3289cc01e51916dec5a7ecc80cb7ef900 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

function start_redis_server {
    redis-server &
}

function start_mysql {
    /usr/bin/mysqld_safe &
    sleep 1
}

function run_forever {
    while [ ! -f /var/log/mysql.log ]; do
        sleep 1
    done
    tail -F /var/log/mysql.log
}

start_redis_server
start_mysql
mysql -uroot -p$MYSQL_ROOT_PASSWORD -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;"
mysql -uroot -p$MYSQL_ROOT_PASSWORD -e "flush privileges;"
run_forever