From 5bb6a27efa3cac22b9578232483e08446606d133 Mon Sep 17 00:00:00 2001 From: WilliamMiceli Date: Fri, 22 Nov 2019 23:17:37 -0500 Subject: [PATCH] Another attempt --- scripts/mysql_secure_install_equivalent.sql | 5 +++++ scripts/mysql_setup.sh | 20 +------------------- 2 files changed, 6 insertions(+), 19 deletions(-) create mode 100644 scripts/mysql_secure_install_equivalent.sql diff --git a/scripts/mysql_secure_install_equivalent.sql b/scripts/mysql_secure_install_equivalent.sql new file mode 100644 index 0000000..4164de6 --- /dev/null +++ b/scripts/mysql_secure_install_equivalent.sql @@ -0,0 +1,5 @@ +UPDATE mysql.user SET authentication_string=PASSWORD('Password1234') 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; \ No newline at end of file diff --git a/scripts/mysql_setup.sh b/scripts/mysql_setup.sh index 5c56b2c..97ac519 100644 --- a/scripts/mysql_setup.sh +++ b/scripts/mysql_setup.sh @@ -1,20 +1,2 @@ #!/bin/bash -mysql_secure_installation << EOF - -y -Password1234 -Password1234 -y -y -y -y -EOF - - - - -#UPDATE mysql.user SET authentication_string=PASSWORD('Password1234') 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; \ No newline at end of file +mysql -u root < /scripts/mysql_secure_install_equivalent.sql \ No newline at end of file