Last active
October 18, 2019 19:59
-
-
Save jeremy-donson/ee6e19d9ba40d4b007a15c154da923be to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# install percona-server (8.0.x) on OSX | |
brew install percona-server | |
mysql.server start | |
mysql -uroot -e 'SELECT VERSION()' | |
mysql.server stop | |
brew unlink percona-server | |
mv /usr/local/var/mysql /usr/local/var/mysql8 | |
# install percona-server (5.7.x) on OSX: https://github.com/djocker/homebrew-common/tree/master | |
brew tap djocker/common | |
brew install percona-server@5.7 | |
brew link -f percona-server@5.7 | |
mysql.server start | |
mysql -uroot -e 'SELECT VERSION()' | |
mysql.server stop | |
brew unlink percona-server@5.7 | |
# swap data dirs to set up for using 8.0.x | |
mv /usr/local/var/mysql /usr/local/var/mysql5 | |
mv /usr/local/var/mysql8 /usr/local/var/mysql | |
# run 8.0.x | |
brew link percona-server | |
mysql.server start | |
mysql -uroot -e 'SELECT VERSION()' | |
[ -d /usr/local/var/mysql5 ] && mysql.server stop | |
brew unlink percona-server | |
# swap data dirs to set up for using 5.7.x | |
mv /usr/local/var/mysql /usr/local/var/mysql8 | |
mv /usr/local/var/mysql5 /usr/local/var/mysql | |
# run 5.7.x | |
brew link -f percona-server@5.7 | |
/usr/local/opt/percona-server@5.7/bin/mysql.server start | |
mysql -uroot -e 'SELECT VERSION()' | |
tstop | |
brew unlink percona-server@5.7 | |
# swap data dirs to set up for using 8.0.x | |
mv /usr/local/var/mysql /usr/local/var/mysql5 | |
mv /usr/local/var/mysql8 /usr/local/var/mysql | |
# check to see if either versions are running. | |
ps -ef | grep mysqld | grep -v grep | |
# ----- assuming we have success above; lets set this up with separate data dirs and config files. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment