-# new requirement is to get the sql root password, since we need to do some sql db configuration.
-echo -n "Please enter the MySQL root account password: "
-# turn off echo but remember former setting.
-stty_orig=`stty -g`
-stty -echo
-read mysql_passwd
-# turn echo back on.
-stty $stty_orig
+# new requirement to have the sql root password, since we need to do some sql db configuration.
+
+echo A
+mysql_passwd="$(load_password /etc/mysql/secret_password)"
+echo B
+if [ -z "$mysql_password" ]; then
+echo C
+ mysql_password="$(read_password "Please enter the MySQL root account password:")"
+echo D
+# echo -n "Please enter the MySQL root account password: "
+# # turn off echo but remember former setting.
+# stty_orig=`stty -g`
+# stty -echo
+# read mysql_passwd
+# # turn echo back on.
+# stty $stty_orig
+fi