# 1. View the version you want to install
brew search mysql
# 2. Specify version installationThe brew install [email protected]# 3. If installation encounters problems (summary), skip the next step if not encountered
# Execute the following two commands. There is a premise that many people change shells. For example, I use Fish to switch to bash to execute, otherwise an error will be reported
You should change the ownership of these directories to your user.
sudo chown -R $(whoami) /usr/local/share/man/man8
And make sure that your user has write permission.
chmod u+w /usr/local/share/man/man8
# 4. Troubleshoot the play problem and continue to execute the install command
# 5. Configure environment variables
echo 'the export PATH = "/ usr/local/opt/[email protected] / bin: $PATH"' >> ~/.bash_profile
source ~/.bash_profile
# 6. Start the serviceMysql. server start Brew services start [email protected]# 7. Initialize, set password, do some Settings
mysql_secure_installation
Copy the code