Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kangfend/97163e625cef47b40a6b0c24b05ce193 to your computer and use it in GitHub Desktop.
Save kangfend/97163e625cef47b40a6b0c24b05ce193 to your computer and use it in GitHub Desktop.

Revisions

  1. @benlinton benlinton revised this gist Dec 20, 2015. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion homebrew_multiple_mysql_versions.md
    Original 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
    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.

  2. @benlinton benlinton revised this gist Dec 20, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion homebrew_multiple_mysql_versions.md
    Original 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 if you only want only one version's agent running at a time (database agents/daemons can use a lot of resources).
    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
  3. @benlinton benlinton revised this gist Dec 20, 2015. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions homebrew_multiple_mysql_versions.md
    Original 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
  4. @benlinton benlinton revised this gist Dec 20, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion homebrew_multiple_mysql_versions.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Multiple MySQL Versions with Homebrew
    ## Multiple MySQL Versions with Homebrew

    Install the current version of mysql.

  5. @benlinton benlinton revised this gist Dec 20, 2015. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions homebrew_multiple_mysql_versions.md
    Original 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
  6. @benlinton benlinton revised this gist Dec 20, 2015. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions homebrew_multiple_mysql_versions.md
    Original 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 -la /usr/local/Cellar/mysql56 # => 5.6.27
    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 -la /usr/local/Cellar/mysql # => 5.7.10
    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 -la /usr/local/bin/mysql
    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).

  7. @benlinton benlinton revised this gist Dec 20, 2015. 1 changed file with 7 additions and 7 deletions.
    14 changes: 7 additions & 7 deletions homebrew_multiple_mysql_versions.md
    Original 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 current version of mysql (including on login)
    # 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 older version of mysql (including on login)
    # 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 current mysql version
    # 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 version of mysql you're on.
    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 daemon running at a time.
    And if you only want only one version's agent running at a time (database agents/daemons can use a lot of resources).

    # Stop current version of mysql
    # Stop agent for current version of mysql
    launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
    rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

    # Stop older version of mysql
    # Stop agent for older version of mysql
    launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mysql56.plist
    rm ~/Library/LaunchAgents/homebrew.mxcl.mysql56.plist
  8. @benlinton benlinton revised this gist Dec 20, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion homebrew_multiple_mysql_versions.md
    Original 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 running at a time.
    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
  9. @benlinton benlinton revised this gist Dec 20, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion homebrew_multiple_mysql_versions.md
    Original 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 check which version you're on.
    To verify which version of mysql you're on.

    # Check which version of mysql is currently symlinked
    ls -la /usr/local/bin/mysql
  10. @benlinton benlinton revised this gist Dec 20, 2015. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions homebrew_multiple_mysql_versions.md
    Original 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

  11. @benlinton benlinton revised this gist Dec 20, 2015. 1 changed file with 11 additions and 13 deletions.
    24 changes: 11 additions & 13 deletions homebrew_multiple_mysql_versions.md
    Original 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
    # Check current mysql version
    ls -la /usr/local/Cellar/mysql
    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 versions.
    Then to switch to the older version.

    # Unlink current mysql version
    brew unlink mysql

    # Link the older version
    brew link mysql56
    brew switch mysql56 5.6.27

    Or force the older link (avoid if possible).
    And to switch back to the current version.

    # To force the link and overwrite all conflicting files
    brew link --overwrite mysql56
    # Unlink older mysql version
    brew unlink mysql56

    Or use the switch versions command.
    # Check current mysql version
    ls -la /usr/local/Cellar/mysql # => 5.7.10

    # To switch versions
    brew switch mysql56 5.6.27
    # Link the current version
    brew switch mysql 5.7.10

    To double check which version you're on.
    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 one version running at a time.
    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
  12. @benlinton benlinton created this gist Dec 20, 2015.
    56 changes: 56 additions & 0 deletions homebrew_multiple_mysql_versions.md
    Original 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