Skip to content

Instantly share code, notes, and snippets.

@n8unc
Created January 21, 2020 15:43
Show Gist options
  • Select an option

  • Save n8unc/8165ccd06d51d78e96bc1580d87cc5a2 to your computer and use it in GitHub Desktop.

Select an option

Save n8unc/8165ccd06d51d78e96bc1580d87cc5a2 to your computer and use it in GitHub Desktop.
# Add these lines to your .bashrc to automatically start MySQL in WSL.
function mysql_startup() {
i=`ps -eaf | grep -i mysql |sed '/^$/d' | wc -l`
if [[ $i > 1 ]]
then
echo "MySQL is already running."
else
sudo service mysql start
echo "MySQL started!"
fi
}
mysql_startup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment