Browse Source

Detect MySQL Username & Password From ~/.my.cnf File

old-stable
Mitesh Shah 12 years ago
parent
commit
bf43653606
  1. 19
      setup/engine

19
setup/engine

@ -56,13 +56,20 @@ MYSQLINFO()
# Get The MySQL Username/Password # Get The MySQL Username/Password
read -p "MySQL Host [localhost]: " MYSQLHOST read -p "MySQL Host [localhost]: " MYSQLHOST
read -p "Enter The MySQL Username: " MYSQLUSER
if [ -f ~/.my.cnf ]
then
MYSQLUSER=$(cat ~/.my.cnf | grep user | cut -d'=' -f2)
MYSQLPASS=$(cat ~/.my.cnf | grep pass | cut -d'=' -f2)
else
read -p "Enter The MySQL Username: " MYSQLUSER
# Turn Off Echo For Passwords # Turn Off Echo For Passwords
stty -echo stty -echo
read -p "Enter The MySQL Password: " MYSQLPASS read -p "Enter The MySQL Password: " MYSQLPASS
stty echo stty echo
echo echo
fi
read -p "Enter The MySQL Database Name [$DOMAIN]: " WPDBNAME read -p "Enter The MySQL Database Name [$DOMAIN]: " WPDBNAME

Loading…
Cancel
Save