Homebrew

From Fishbowl Advanced
Revision as of 13:32, 20 March 2023 by MK (talk | contribs) (Updating to fix current process and handle M1 specific instructions better.)
Homebrew.png

The first time that Fishbowl is installed on a Mac, MySQL will need to be installed. As an alternative to the MySQL installer, MySQL can also be installed using Terminal and a package manager called Homebrew.

Follow the instructions below to install MySQL using Homebrew. For those not comfortable with a command-line interface, click here.

  1. Open a web browser and type www.brew.sh in the address bar.
  2. Copy the text at the top of the webpage and run it in the Terminal application. For example:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

    or
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  3. Enter your Mac user password when requested and complete the installation. After that is complete, additional actions may be needed:
    • Intel based Mac: No further action needed on step 3.
    • Apple Silicon Mac (M1 or M2): There will be two additional commands to run that will look like this. Check your terminal window for the exact commands to run on your machine.
      • echo 'eval $(/opt/homebrew/bin/brew shellenv)' >> /Users/USERNAME/.zprofile
        • Update the USERNAME to your username
      • eval $(/opt/homebrew/bin/brew shellenv)
  4. Type the following command in a new Terminal window.
    brew install mysql@5.7
  5. Run the following command.
    brew link mysql@5.7 --force
  6. To set the root password, start the MySQL service by typing the following command.
    brew services start mysql@5.7
  7. Run the following command.
    mysql_secure_installation
  8. Follow the instructions to create a new password and make changes to the server. This command can also be used to reset the root password if you know the current password.
    • Validate complex password? - Optional
    • Remove Anonymous Users? - Yes
    • Disallow root login remotely? - Optional
    • Remove test database? - Optional
    • Reload privilege tables now? - Yes
  9. MySQLWorkbench is an optional tool for viewing the database. It can be installed with the following command.
    brew install Caskroom/cask/mysqlworkbench
  10. The default path for the MySQL install will be:
    • Intel based Mac: /usr/local/Cellar/mysql/5.7.41 (or the current version number)
    • Apple Silicon Mac (M1 or M2): /opt/homebrew/Cellar/mysql@5.7/5.7.41 (or the current version number)
  11. Download and install Fishbowl.
  12. Stop the MySQL service by typing the following command in Terminal.
    brew services stop mysql@5.7
  13. Copy the my.cnf file from Applications/Fishbowl/server/bin/my.cnf
  14. Open Finder and press command + shift + g (Go menu > Go to Folder). Type /etc and then click Go. Paste the my.cnf file that was copied in the previous step.
  15. Right-click the /etc/my.cnf file, click Get Info, and verify that the permissions are as follows:
    1. USERNAME (Me) - Read & Write
    2. wheel - Read Only
    3. everyone - Read Only
  16. Open Applications/Fishbowl/server/bin/eve.properties and add the following line (updating the current version number as needed):
    • Intel based Mac: macMySqlPath=/usr/local/Cellar/mysql/5.7.41 (or the current version number)
    • Apple Silicon Mac (M1 or M2): macMySqlPath=/opt/homebrew/Cellar/mysql@5.7/5.7.41 (or the current version number)
  17. Restart MySQL by running the following command in Terminal.
    brew services restart mysql@5.7
  18. Start Fishbowl using the shortcuts created on the desktop. Fishbowl can also be opened with Applications/Fishbowl/server/bin/Fishbowl Server and Applications/Fishbowl/client/bin/Fishbowl Client.
  19. Follow these steps to create a new MySQL database.

Below are some additional Terminal commands that may be helpful.

brew services start mysql@5.7
brew services stop mysql@5.7
brew services restart mysql@5.7
mysql --help

If the installer did not set proper folder permissions, set the permissions for the Fishbowl folder as outlined here.