start mysql, Script to automatically start mysql, Hostripples Web Hosting

Script to automatically start mysql

start mysql, Script to automatically start mysql, Hostripples Web HostingThe following script is used to  start mysql automatically when it is failed or stopped on the server.

You can set 2 min cron “*/2 * * * * /bin/sh /root/automysqlstart.sh” and it restart the mysql automatically.

#!/bin/bash

#Checking whether MySQL is alive or not

if mysqladmin ping | grep -q "alive"; then

echo "MySQL is up"

else

/etc/init.d/mysqld restart

fi


Script to automatically start mysql, Hostripples Web Hosting
Vishwajit Kale
Vishwajit Kale blazed onto the digital marketing scene back in 2015 and is the digital marketing strategist of Hostripples, a company that aims to provide affordable web hosting solutions. Vishwajit is experienced in digital and content marketing along with SEO. He's fond of writing technology blogs, traveling and reading.