summaryrefslogtreecommitdiffstats
path: root/setup/projects/adei/files/adei_init/mysql/initdb.sh
blob: 2790c2da981134b59912445a2ec98e8238f74e6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
(
    dir=$(dirname $0)
    cd $dir

    # Waiting until server is initialized
    e=1
    while [ $e -ne 0 ]; do
        sleep 5
        MYSQL_PWD="$MYSQL_PASSWORD" mysql -h 127.0.0.1 -u $MYSQL_USER -D $MYSQL_DATABASE -e 'SELECT 1'
        e=$?
    done


    cat adei.sql | awk "{ gsub(/@PWD@/, \"$MYSQL_PMA_PASSWORD\"); print }" | MYSQL_PWD="$MYSQL_ROOT_PASSWORD" mysql -u root -h $HOSTNAME
    #cat pma.sql | awk "{ gsub(/@PWD@/, \"$MYSQL_PMA_PASSWORD\"); print }" | MYSQL_PWD="$MYSQL_ROOT_PASSWORD" mysql -u root -h $HOSTNAME
)