Update create-mysql-db-and-user.sh
This commit is contained in:
parent
66f4908baf
commit
3661540de5
1 changed files with 4 additions and 4 deletions
|
@ -10,15 +10,15 @@ function create_mysql_db_and_user() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mysql -u root <<MYSQL_SCRIPT
|
mysql -u root <<MYSQL_SCRIPT
|
||||||
CREATE DATABASE $2;
|
CREATE DATABASE $1;
|
||||||
CREATE USER '$1'@'localhost' IDENTIFIED BY '$PASS';
|
CREATE USER '$2'@'localhost' IDENTIFIED BY '$PASS';
|
||||||
GRANT ALL PRIVILEGES ON $2.* TO '$1'@'localhost';
|
GRANT ALL PRIVILEGES ON $1.* TO '$2'@'localhost';
|
||||||
FLUSH PRIVILEGES;
|
FLUSH PRIVILEGES;
|
||||||
MYSQL_SCRIPT
|
MYSQL_SCRIPT
|
||||||
|
|
||||||
echo "MySQL user and database created."
|
echo "MySQL user and database created."
|
||||||
echo "Username: $1"
|
|
||||||
echo "Database: $1"
|
echo "Database: $1"
|
||||||
|
echo "Username: $2"
|
||||||
echo "Password: $PASS"
|
echo "Password: $PASS"
|
||||||
echo "Success!"
|
echo "Success!"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue