Note that below script will check whether MySQL is up or not.
#!/bin/bash
#Checking whether MySQL is alive or not
if mysqladmin -u root -pxxxx ping | grep -q "alive"; then
echo "MySQL is up"
else
/etc/init.d/mysqld restart
fi
#!/bin/bash
#Checking whether MySQL is alive or not
if mysqladmin -u root -pxxxx ping | grep -q "alive"; then
echo "MySQL is up"
else
/etc/init.d/mysqld restart
fi
No comments:
Post a Comment