optimize mariadb check
This commit is contained in:
parent
8787ef57b5
commit
a4dee03140
@ -30,7 +30,7 @@ msg_info "Setting up database"
|
||||
DB_NAME=firefly
|
||||
DB_USER=firefly
|
||||
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
|
||||
MYSQL_VERSION=$(mysql --version | grep -oP 'Distrib \K[0-9]+\.[0-9]+\.[0-9]+')
|
||||
MYSQL_VERSION=$(mariadb --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -n1)
|
||||
mysql -u root -e "CREATE DATABASE $DB_NAME;"
|
||||
mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');"
|
||||
mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
|
||||
|
Loading…
x
Reference in New Issue
Block a user