Skip to content

Commit

Permalink
Merge pull request #1 from LeoMouyna/master
Browse files Browse the repository at this point in the history
doc(api): adding install and launch documentation

create database now has custom password set by the user
  • Loading branch information
Debrej authored Jan 7, 2020
2 parents 3115562 + c97c120 commit 037d216
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions api/server/create_database.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#!/usr/bin/env bash
echo "Select the project user password: "
read -s project_a_pwd

echo "Enter the root password for mysql"
mysql -u root -p <<EOF
CREATE DATABASE project_a;
CREATE USER 'project_a'@'localhost' IDENTIFIED WITH mysql_native_password BY 'project_a';
CREATE USER 'project_a'@'localhost' IDENTIFIED WITH mysql_native_password BY '$project_a_pwd';
GRANT ALL PRIVILEGES ON project_a.* TO 'project_a'@'localhost';
EOF
EOF

echo '{
"pwd_project_a": "$project_a_pwd"
}' > assets/json/pwd.json

0 comments on commit 037d216

Please sign in to comment.