summaryrefslogtreecommitdiff
path: root/scripts/create_db.sh
blob: 29404c149625afef5e687aa866d79370ed3a5825 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/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

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

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