Forked from benlinton/multiple_mysql_versions_for_development.md
Created
August 31, 2016 16:01
-
-
Save kangfend/97163e625cef47b40a6b0c24b05ce193 to your computer and use it in GitHub Desktop.
Revisions
-
benlinton revised this gist
Dec 20, 2015 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -50,7 +50,10 @@ And to switch back to the current version. To verify which mysql version you're on at any time. # Check which version of mysql is currently symlinked ls -l /usr/local/bin/mysql # => /usr/local/bin/mysql@ -> ../Cellar/mysql56/5.6.27/bin/mysql # Or using the mysql command mysql --version And to unload a mysql agent for a given version. -
benlinton revised this gist
Dec 20, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -52,7 +52,7 @@ To verify which mysql version you're on at any time. # Check which version of mysql is currently symlinked ls -l /usr/local/bin/mysql And to unload a mysql agent for a given version. # Stop agent for current version of mysql launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist -
benlinton revised this gist
Dec 20, 2015 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,9 @@ ## Multiple MySQL Versions with Homebrew For homebrew version 0.9.5. brew -v # => Homebrew 0.9.5 Install the current version of mysql. # Install current mysql version -
benlinton revised this gist
Dec 20, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ ## Multiple MySQL Versions with Homebrew Install the current version of mysql. -
benlinton revised this gist
Dec 20, 2015 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ # Multiple MySQL Versions with Homebrew Install the current version of mysql. # Install current mysql version -
benlinton revised this gist
Dec 20, 2015 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -25,7 +25,7 @@ Then to switch to the older version. brew unlink mysql # Check older mysql version ls /usr/local/Cellar/mysql56 # => 5.6.27 # Link the older version brew switch mysql56 5.6.27 @@ -36,15 +36,15 @@ And to switch back to the current version. brew unlink mysql56 # Check current mysql version ls /usr/local/Cellar/mysql # => 5.7.10 # Link the current version brew switch mysql 5.7.10 To verify which mysql version you're on at any time. # Check which version of mysql is currently symlinked ls -l /usr/local/bin/mysql And if you only want only one version's agent running at a time (database agents/daemons can use a lot of resources). -
benlinton revised this gist
Dec 20, 2015 . 1 changed file with 7 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ Install the current version of mysql. # Install current mysql version brew install mysql # Start agent for current version of mysql (including on login) ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist @@ -15,7 +15,7 @@ Install the older version of mysql. # Install older mysql version brew install homebrew/versions/mysql56 # Start agent for older version of mysql (including on login) ln -sfv /usr/local/opt/mysql56/*.plist ~/Library/LaunchAgents launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql56.plist @@ -24,7 +24,7 @@ Then to switch to the older version. # Unlink current mysql version brew unlink mysql # Check older mysql version ls -la /usr/local/Cellar/mysql56 # => 5.6.27 # Link the older version @@ -41,17 +41,17 @@ And to switch back to the current version. # Link the current version brew switch mysql 5.7.10 To verify which mysql version you're on at any time. # Check which version of mysql is currently symlinked ls -la /usr/local/bin/mysql And if you only want only one version's agent running at a time (database agents/daemons can use a lot of resources). # Stop agent for current version of mysql launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist # Stop agent for older version of mysql launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mysql56.plist rm ~/Library/LaunchAgents/homebrew.mxcl.mysql56.plist -
benlinton revised this gist
Dec 20, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -46,7 +46,7 @@ To verify which version of mysql you're on. # Check which version of mysql is currently symlinked ls -la /usr/local/bin/mysql And if you only want only one version's daemon running at a time. # Stop current version of mysql launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist -
benlinton revised this gist
Dec 20, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -41,7 +41,7 @@ And to switch back to the current version. # Link the current version brew switch mysql 5.7.10 To verify which version of mysql you're on. # Check which version of mysql is currently symlinked ls -la /usr/local/bin/mysql -
benlinton revised this gist
Dec 20, 2015 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -24,6 +24,9 @@ Then to switch to the older version. # Unlink current mysql version brew unlink mysql # Check current mysql version ls -la /usr/local/Cellar/mysql56 # => 5.6.27 # Link the older version brew switch mysql56 5.6.27 -
benlinton revised this gist
Dec 20, 2015 . 1 changed file with 11 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -7,9 +7,6 @@ Install the current version of mysql. ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist Install the older version of mysql. # Find older mysql versions @@ -22,30 +19,31 @@ Install the older version of mysql. ln -sfv /usr/local/opt/mysql56/*.plist ~/Library/LaunchAgents launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql56.plist Then to switch to the older version. # Unlink current mysql version brew unlink mysql # Link the older version brew switch mysql56 5.6.27 And to switch back to the current version. # Unlink older mysql version brew unlink mysql56 # Check current mysql version ls -la /usr/local/Cellar/mysql # => 5.7.10 # Link the current version brew switch mysql 5.7.10 To check which version you're on. # Check which version of mysql is currently symlinked ls -la /usr/local/bin/mysql And if you only want only one version running at a time. # Stop current version of mysql launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist -
benlinton created this gist
Dec 20, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,56 @@ Install the current version of mysql. # Install current mysql version brew install mysql # Start current version of mysql (including on login) ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist # Check current mysql version ls -la /usr/local/Cellar/mysql Install the older version of mysql. # Find older mysql versions brew search mysql # Install older mysql version brew install homebrew/versions/mysql56 # Start older version of mysql (including on login) ln -sfv /usr/local/opt/mysql56/*.plist ~/Library/LaunchAgents launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql56.plist Then to switch versions. # Unlink current mysql version brew unlink mysql # Link the older version brew link mysql56 Or force the older link (avoid if possible). # To force the link and overwrite all conflicting files brew link --overwrite mysql56 Or use the switch versions command. # To switch versions brew switch mysql56 5.6.27 To double check which version you're on. # Check which version of mysql is currently symlinked ls -la /usr/local/bin/mysql And if you only want one version running at a time. # Stop current version of mysql launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist # Stop older version of mysql launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mysql56.plist rm ~/Library/LaunchAgents/homebrew.mxcl.mysql56.plist