Skip to content

Instantly share code, notes, and snippets.

@tagliala
Created January 28, 2016 10:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tagliala/d5a7a0ebba4bdfef60e9 to your computer and use it in GitHub Desktop.
Save tagliala/d5a7a0ebba4bdfef60e9 to your computer and use it in GitHub Desktop.
Switch from mysql56 to mysql
#!/bin/bash
if mysql --version | grep -q "Distrib 5.6"
then
echo "Deactivating MySQL 5.6";
mysql.server stop
brew unlink mysql56
mv /usr/local/var/mysql /usr/local/var/mysql56
mv /usr/local/var/mysql.prev /usr/local/var/mysql
brew link mysql
else
echo "Activating MySQL 5.6";
mysql.server stop
brew unlink mysql
mv /usr/local/var/mysql /usr/local/var/mysql.prev
mv /usr/local/var/mysql56 /usr/local/var/mysql
brew link mysql56
fi
echo "Please reboot the machine";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment