aboutsummaryrefslogtreecommitdiffstats
path: root/docker/instance_run.sh
blob: 0848d0bc722cbe5b40151e0a3cf9efa92be320d1 (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 10
}

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