From 1c2980c416c21f535285734c814601456e7d760f Mon Sep 17 00:00:00 2001 From: WilliamMiceli Date: Sat, 23 Nov 2019 00:35:47 -0500 Subject: [PATCH] Added the database and a user to test out the PHP pages with --- scripts/mysql_setup.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/mysql_setup.sh b/scripts/mysql_setup.sh index 0e47f4e..464a4fa 100644 --- a/scripts/mysql_setup.sh +++ b/scripts/mysql_setup.sh @@ -2,16 +2,18 @@ service mysql start # Perform the equivalent of running `mysql_secure_installation` -#mysql -e "UPDATE mysql.user SET authentication_string=PASSWORD('Password1234') WHERE User='root';" -#ysql -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');" -#mysql -e "DELETE FROM mysql.user WHERE User='';" -#mysql -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test_%';" -#mysql -e "FLUSH PRIVILEGES;" - mysql -u root << EOF -UPDATE mysql.user SET authentication_string=PASSWORD('Password1234') WHERE User='root'; +UPDATE mysql.user SET authentication_string=PASSWORD('Password123') WHERE User='root'; DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1'); DELETE FROM mysql.user WHERE User=''; DELETE FROM mysql.db WHERE Db='test' OR Db='test_%'; FLUSH PRIVILEGES; +EOF + +# Setting up the basics +mysql -u root << EOF +CREATE USER 'web'@'localhost' IDENTIFIED BY 'Password456'; +CREATE DATABASE friendBook; +GRANT ALL PRIVILEGES ON friendBook . * TO 'web'@'localhost'; +FLUSH PRIVILEGES; EOF \ No newline at end of file