
Copy the code below highlighted in blue , save it in a file and execute for output. There are variables DBUSER,DBPASS,DBHOST which be configured based on your installation.
#!/bin/sh
#################################################################################
# Configure the DB user name here.
# Ex. DBUSER="employee"
#################################################################################
DBUSER="employee"
#################################################################################
# Configure the DB user password here.
# Ex. DBPASS="test"
#################################################################################
DBPASS="m@gictest"
#################################################################################
# Connfigure the hostname here.
# Ex. DBHOST="10.10.23.114" . For localhost enter 127.0.0.1
#################################################################################
DBHOST="10.3.2.1"
#################################################################################
mysql -u $DBUSER -p$DBUSER -h $DBHOST << EOF
show processlist;
EOF
#################################################################################
Hope this is useful to some Linux beginners