Last active
March 22, 2023 14:16
-
-
Save DjakaTechnology/15ef87521c2750f9f31c73241bb35fb2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
domName=insurance | |
username=administrator | |
pass=administrator | |
echo "Creating database..." | |
echo "DROP DATABASE IF EXISTS wordpress_$domName;" | |
mysql -e "DROP DATABASE IF EXISTS wordpress_$domName;" | |
echo "CREATE DATABASE wordpress_$domName;" | |
mysql -e "CREATE DATABASE wordpress_$domName;" | |
dbUserName="${username}_${domName}" | |
mysql -e "DROP USER IF EXISTS '$dbUserName'@'localhost';" | |
echo "DROP USER IF EXISTS '$dbUserName'@'localhost';" | |
mysql -e "CREATE USER '$dbUserName'@'localhost' IDENTIFIED BY '$pass'" | |
echo "CREATE USER '$dbUserName'@'localhost' IDENTIFIED BY '$pass'" | |
mysql -e "GRANT ALL PRIVILEGES ON wordpress_$domName.* TO $dbUserName@localhost;" | |
echo "GRANT ALL PRIVILEGES ON wordpress_$domName.* TO '$dbUserName'@'localhost';" | |
mysql -e "FLUSH PRIVILEGES;" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment