summaryrefslogtreecommitdiff
path: root/scripts/create_db.sh
blob: ecd239ea2f8e9e9eb2f165e9b2a6776429e14211 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
echo "choose a password for the database:"
read -s input

echo "use sudo? [y/n]"
read answer

if [[ $answer == 'y' ]] then
    sudo="sudo"
fi

echo "creating database..."
$sudo $mariadb -u root <<EOF
CREATE OR REPLACE USER 'balalaika_user'@'%' IDENTIFIED BY '$input';
EOF

$sudo $mariadb -u root < ./scripts/create_db.sql