Installations Of Homebrew, MySQL & Redis On MacOS

I summary this article after I finished installation of Homebrew on my 2 laptops-MacBook Pro(Interl Chip) & MacBook Air(Apple Silicone Chip), there is nothing wrong with running the command below. Just record it for reference and hope it could help someone else.

Installation of Homebrew

Execute the command as below, the source is from China mainland so we don’t need to worry too much about the bad Internet connection.

1
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

After the tip of your terminal notified that installation is finished.Restart or reload your terminal by below command

1
source /Users/hyk/.zprofile

Here is the logs for reference.

Logs Of Homebrew Installation

Per logs , we can see it may need to configure git therefor follow the tips directly like below

1
2
3
4
#add those below to git config
git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core

git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask

After run all above, we have finished the installation of Homebrew.We can install some developed tools by related command.

1
2
3
4
5
6
7
8
#to see all commands
brew commands

#see the version of Homebrew
brew -v

#see the volume of Homebrew
brew info

Installation Of MySQL-5.7

We could install MySQL by Homebrew easily.

1
2
3
4
5
#search mysql
brew search mysql

#instal mysql
brew install mysql@5.7

MySQL logs for reference.

Logs Of MySQL Installation

After finished installation of MySQL,execute those commands as below

1
2
3
4
5
6
7
8
9
10
11
12
#echo the PATH to ~/.zshrc
echo 'export PATH="/opt/homebrew/opt/mysql@5.7/bin:$PATH"' >> ~/.zshrc


#reload the file to make the PATH into effect
source ~/.zshrc

#restart mysql
brew services restart mysql@5.7

#then we can reset the password
mysql_secure_installation

Initialize password of MySQL

Initialize Password Of MySQL

At this point, we have completed installation of MySQL-5.7


Installation Of Redis

Redis is convenient to use on MacOS, plus, it’s easy to get it by Homebrew.Let just go ahead~

1
2
3
4
5
6
7
8
#search redis
brew search redis

#in fact , sometimes you can just skip the search process
brew install redis

#after restart reids ,we can use it
brew services restart redis

Connect To Local Redis


Installations Of Homebrew, MySQL & Redis On MacOS
https://iceswear.github.io/2022/11/05/InstallationsOfHomebrewMySQL&RedisOnMacOS/
Author
Spike Wong
Posted on
November 5, 2022
Licensed under