write an ubuntu script that will start mysql service whenever it goes down
#!/bin/bash
if [[ ! "$(/usr/sbin/service mysql status)" =~ "start/running" ]]
then
/usr/sbin/service mysql start
fi
write an ubuntu script that will start mysql service whenever it goes down
#!/bin/bash
if [[ ! "$(/usr/sbin/service mysql status)" =~ "start/running" ]]
then
/usr/sbin/service mysql start
fi
write an ubuntu script that will start mysql service whenever it goes down
#!/bin/bash
# Check if MySQL is running
sudo service mysql status > /dev/null 2>&1
# Restart the MySQL service if it's not running.
if [ $? != 0 ]; then
echo -e "MySQL Service was down. Restarting now...\n"
sudo service mysql restart
else
echo -e "MySQL Service is running already. Nothing to do here.\n"
fi
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us