I am trying to check if a MYSQL user exists. That's all I have. I fall for receiving a response from the exit.
echo -e "What is the MYSQL username called"
read DBUSER
if [ -z "$DBUSER" ]
then
exit
mysql -uUSER -pPASS -e "SELECT EXISTS(SELECT 1 FROM mysql.user WHERE user = '$DBUSER')";
if
yes
do this
else
do this
this is the result that I get
+
| EXISTS(SELECT 1 FROM mysql.user WHERE user = 'bob') |
+
| 1 |
+
Can anyone please help
source
share