Please review my Bash code to create an authenticated, all privileged MySQL user plus a DB with the same name, through the MySQL CLI:
read -sp "DB user password:" dbrootp_1 && echo
read -sp "DB user password again:" dbuserp_2dbrootp_2 && echo
read -sp "DB user password:" dbrootp_1dbuserp_1 && echo
read -sp "DB user password again:" dbuserp_2 && echo
if [ "$dbrootp_1" != "$dbrootp_2" ]; then echo "Values unmatched" && exit 1 fi
if [ "$dbuserp_1" != "$dbuserp_2" ]; then echo "Values unmatched" && exit 1 fi
cat <<-DBSTACK | mysql -u root -p"$dbrootp"
CREATE USER "$domain"@"localhost" IDENTIFIED BY "$dbuserp";
CREATE DATABASE "$domain";
GRANT ALL PRIVILEGES ON "$domain".* TO "$domain"@"localhost";
DBSTACK