Skip to content

Instantly share code, notes, and snippets.

@lucmski
Forked from robhrt7/MySQL_5-7_macOS.md
Created March 12, 2019 16:28
Show Gist options
  • Save lucmski/009f0ad87fffb9638d153c3e82663e74 to your computer and use it in GitHub Desktop.
Save lucmski/009f0ad87fffb9638d153c3e82663e74 to your computer and use it in GitHub Desktop.

Revisions

  1. @robhrt7 robhrt7 renamed this gist Jul 17, 2018. 1 changed file with 12 additions and 10 deletions.
    22 changes: 12 additions & 10 deletions MySQL_macOS_Sierra.md → MySQL_5-7_macOS.md
    Original file line number Diff line number Diff line change
    @@ -1,31 +1,33 @@
    ## Install MySQL on macOS Sierra
    This procedure explains how to install [MySQL](https://www.mysql.com) using [Homebrew](http://brew.sh) on macOS Sierra 10.12
    > This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).
    ## Install MySQL 5.7 on macOS
    This procedure explains how to install [MySQL](https://www.mysql.com) using [Homebrew](http://brew.sh) on macOS (Sierra 10.12 and up)

    ### Install Homebrew
    * Installing Homebrew is effortless, open Terminal and enter :
    `$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"`
    * **Note:** Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

    ### Install MySQL
    At this time of writing, Homebrew has MySQL version **5.7.15** as default formulae in its main repository :
    At this time of writing, Homebrew has MySQL version **8** as default, but as we're aiming to get **5.7**, we'll need to append `@5.7` to the default package key:

    * Enter the following command : `$ brew info mysql`
    * Expected output: **mysql: stable 5.7.15 (bottled)**
    * Enter the following command : `$ brew info mysql@5.7`
    * Expected output: **mysql@5.7: stable 5.7.22 (bottled) [keg-only]**

    To install MySQL enter : `$ brew install mysql`

    To install MySQL enter : `$ brew install [email protected]`

    ## Additional configuration
    ### Homebrew

    * Install **brew services** first : `$ brew tap homebrew/services`
    * Load and start the MySQL service : `$ brew services start mysql`.
    * Load and start the MySQL service : `$ brew services start mysql@5.7`.
    Expected output : **Successfully started `mysql` (label: homebrew.mxcl.mysql)**

    * Check of the MySQL service has been loaded : `$ brew services list` <sup>[1](#1)</sup>

    * Force link 5.7 version - `$ brew link [email protected] --force`
    * Verify the installed MySQL instance : `$ mysql -V`.
    Expected output : **Ver 14.14 Distrib 5.7.15, for osx10.12 (x86_64)**
    Expected output : **Ver 14.14 Distrib 5.7.22, for osx10.13 (x86_64)**


    ### MySQL
    @@ -40,7 +42,7 @@ Current version available: **1.1.2**


    ##### Comments
    <a name="1"><sup>1</sup></a> The `brew services start mysql` - instruction is equal to :
    <a name="1"><sup>1</sup></a> The `brew services start mysql@5.7` - instruction is equal to :

    ```
    $ ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
  2. @nrollr nrollr revised this gist Dec 19, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions MySQL_macOS_Sierra.md
    Original file line number Diff line number Diff line change
    @@ -34,12 +34,12 @@ Open Terminal and execute the following command to set the root password:

    > **Important** : Use the single ‘quotes’ to surround the password and make sure to select a strong password!
    ###Database Management
    ### Database Management
    To manage your databases, I recommend using [Sequel Pro](http://www.sequelpro.com), a MySQL management tool designed for macOS.
    Current version available: **1.1.2**


    #####Comments
    ##### Comments
    <a name="1"><sup>1</sup></a> The `brew services start mysql` - instruction is equal to :

    ```
  3. @nrollr nrollr revised this gist Oct 8, 2016. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion MySQL_macOS_Sierra.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,6 @@
    ## Install MySQL on macOS Sierra
    This procedure explains how to install [MySQL](https://www.mysql.com) using [Homebrew](http://brew.sh) on macOS Sierra 10.12

    ## Procedure
    ### Install Homebrew
    * Installing Homebrew is effortless, open Terminal and enter :
    `$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"`
  4. @nrollr nrollr revised this gist Oct 8, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion MySQL_macOS_Sierra.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Install MySQL on macOS Sierra
    ## Install MySQL on macOS Sierra
    This procedure explains how to install [MySQL](https://www.mysql.com) using [Homebrew](http://brew.sh) on macOS Sierra 10.12

    ## Procedure
  5. @nrollr nrollr revised this gist Oct 8, 2016. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion MySQL_macOS_Sierra.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,7 @@
    ## Install MySQL on macOS Sierra
    # Install MySQL on macOS Sierra
    This procedure explains how to install [MySQL](https://www.mysql.com) using [Homebrew](http://brew.sh) on macOS Sierra 10.12

    ## Procedure
    ### Install Homebrew
    * Installing Homebrew is effortless, open Terminal and enter :
    `$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"`
  6. @nrollr nrollr revised this gist Oct 8, 2016. 1 changed file with 3 additions and 5 deletions.
    8 changes: 3 additions & 5 deletions MySQL_macOS_Sierra.md
    Original file line number Diff line number Diff line change
    @@ -6,8 +6,6 @@ This procedure explains how to install [MySQL](https://www.mysql.com) using [Hom
    `$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"`
    * **Note:** Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.



    ### Install MySQL
    At this time of writing, Homebrew has MySQL version **5.7.15** as default formulae in its main repository :

    @@ -17,8 +15,8 @@ At this time of writing, Homebrew has MySQL version **5.7.15** as default formul
    To install MySQL enter : `$ brew install mysql`


    #### Additional configuration
    To load and start the MySQL background service, open Terminal and execute the following commands :
    ## Additional configuration
    ### Homebrew

    * Install **brew services** first : `$ brew tap homebrew/services`
    * Load and start the MySQL service : `$ brew services start mysql`.
    @@ -30,7 +28,7 @@ Expected output : **Successfully started `mysql` (label: homebrew.mxcl.mysql)**
    Expected output : **Ver 14.14 Distrib 5.7.15, for osx10.12 (x86_64)**


    ###Configure MySQL
    ### MySQL
    Open Terminal and execute the following command to set the root password:
    `mysqladmin -u root password 'yourpassword'`

  7. @nrollr nrollr revised this gist Oct 8, 2016. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions MySQL_macOS_Sierra.md
    Original file line number Diff line number Diff line change
    @@ -21,13 +21,13 @@ To install MySQL enter : `$ brew install mysql`
    To load and start the MySQL background service, open Terminal and execute the following commands :

    * Install **brew services** first : `$ brew tap homebrew/services`
    * Load and start the MySQL service : `$ brew services start mysql`
    * Expected output : **Successfully started `mysql` (label: homebrew.mxcl.mysql)**
    * Load and start the MySQL service : `$ brew services start mysql`.
    Expected output : **Successfully started `mysql` (label: homebrew.mxcl.mysql)**

    * Check of the MySQL service has been loaded : `$ brew services list` <sup>[1](#1)</sup>

    * Verify the installed MySQL instance : `$ mysql -V`
    * Expected output : **Ver 14.14 Distrib 5.7.15, for osx10.12 (x86_64)**
    * Verify the installed MySQL instance : `$ mysql -V`.
    Expected output : **Ver 14.14 Distrib 5.7.15, for osx10.12 (x86_64)**


    ###Configure MySQL
  8. @nrollr nrollr revised this gist Oct 8, 2016. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion MySQL_macOS_Sierra.md
    Original file line number Diff line number Diff line change
    @@ -37,7 +37,9 @@ Open Terminal and execute the following command to set the root password:
    > **Important** : Use the single ‘quotes’ to surround the password and make sure to select a strong password!
    ###Database Management
    To manage your databases, I recommend using [Sequel Pro](http://www.sequelpro.com), a MySQL management tool designed for macOS. Current version available: **1.1.2**
    To manage your databases, I recommend using [Sequel Pro](http://www.sequelpro.com), a MySQL management tool designed for macOS.
    Current version available: **1.1.2**


    #####Comments
    <a name="1"><sup>1</sup></a> The `brew services start mysql` - instruction is equal to :
  9. @nrollr nrollr revised this gist Oct 8, 2016. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions MySQL_macOS_Sierra.md
    Original file line number Diff line number Diff line change
    @@ -40,7 +40,9 @@ Open Terminal and execute the following command to set the root password:
    To manage your databases, I recommend using [Sequel Pro](http://www.sequelpro.com), a MySQL management tool designed for macOS. Current version available: **1.1.2**

    #####Comments
    <a name="1"><sup>1</sup></a> The `brew services start mysql` - command is equal to :
    <a name="1"><sup>1</sup></a> The `brew services start mysql` - instruction is equal to :

    * `ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents`
    * and `launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist`
    ```
    $ ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
    $ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
    ```
  10. @nrollr nrollr created this gist Oct 8, 2016.
    46 changes: 46 additions & 0 deletions MySQL_macOS_Sierra.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,46 @@
    ## Install MySQL on macOS Sierra
    This procedure explains how to install [MySQL](https://www.mysql.com) using [Homebrew](http://brew.sh) on macOS Sierra 10.12

    ### Install Homebrew
    * Installing Homebrew is effortless, open Terminal and enter :
    `$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"`
    * **Note:** Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.



    ### Install MySQL
    At this time of writing, Homebrew has MySQL version **5.7.15** as default formulae in its main repository :

    * Enter the following command : `$ brew info mysql`
    * Expected output: **mysql: stable 5.7.15 (bottled)**

    To install MySQL enter : `$ brew install mysql`


    #### Additional configuration
    To load and start the MySQL background service, open Terminal and execute the following commands :

    * Install **brew services** first : `$ brew tap homebrew/services`
    * Load and start the MySQL service : `$ brew services start mysql`
    * Expected output : **Successfully started `mysql` (label: homebrew.mxcl.mysql)**

    * Check of the MySQL service has been loaded : `$ brew services list` <sup>[1](#1)</sup>

    * Verify the installed MySQL instance : `$ mysql -V`
    * Expected output : **Ver 14.14 Distrib 5.7.15, for osx10.12 (x86_64)**


    ###Configure MySQL
    Open Terminal and execute the following command to set the root password:
    `mysqladmin -u root password 'yourpassword'`

    > **Important** : Use the single ‘quotes’ to surround the password and make sure to select a strong password!
    ###Database Management
    To manage your databases, I recommend using [Sequel Pro](http://www.sequelpro.com), a MySQL management tool designed for macOS. Current version available: **1.1.2**

    #####Comments
    <a name="1"><sup>1</sup></a> The `brew services start mysql` - command is equal to :

    * `ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents`
    * and `launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist`