#!/bin/bash
read -p "enter mysql username :" db_user
read -p "enter the password :" db_password
RESULT=`mysql --user="$db_user" --password="$db_password" --skip-column-names -e "SHOW DATABASES LIKE 'mysql'"` 2> /dev/null
if [ $RESULT ]; then
echo "successful, connection estabilished"
else
echo "username and password doesn't match"
fi
read -p "enter mysql username :" db_user
read -p "enter the password :" db_password
RESULT=`mysql --user="$db_user" --password="$db_password" --skip-column-names -e "SHOW DATABASES LIKE 'mysql'"` 2> /dev/null
if [ $RESULT ]; then
echo "successful, connection estabilished"
else
echo "username and password doesn't match"
fi
No comments:
Post a Comment