From 8986270948011cd4cb2673f37ebb75650773c63a Mon Sep 17 00:00:00 2001 From: TommyTran732 <57488583+tommytran732@users.noreply.github.com> Date: Sat, 13 Jun 2020 04:55:52 -0400 Subject: [PATCH] Update mariadb-104.sh --- mariadb-104.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mariadb-104.sh b/mariadb-104.sh index 3a8de51..15926aa 100644 --- a/mariadb-104.sh +++ b/mariadb-104.sh @@ -3,10 +3,11 @@ output(){ } mariadb_root_reset(){ - rootpassword=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1` + rootpassword=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1` + Q0="SET old_passwords=0;" Q1="SET PASSWORD FOR root@localhost = PASSWORD('$rootpassword');" Q2="FLUSH PRIVILEGES;" - SQL="${Q1}${Q2}" + SQL="${Q0}${Q1}${Q2}" mysql mysql -e "$SQL" output "Your MariaDB root password is $rootpassword" }