Mac M1 安装MySQL
安装MySQL
手动安装
手动安装是需要下载合适版本的MySQL,然后进行安装。下载地址:https://dev.mysql.com/downloads/mysql/
自动安装
使用终端命令行,直接可以进行安装,前提是电脑上已经安装了Homebrew。
终端使用 brew install mysql
➜ ~ brew install mysql
Error: Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew)!
To rerun under ARM use:
arch -arm64 brew install ...
To install under x86_64, install Homebrew into /usr/local.
如果是M1 芯片的Mac的话,使用 arch -arm64 brew install mysql
命令
下面是更新的时候终端里的一些日志
➜ ~ arch -arm64 brew install mysql
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/libevent-2.1.12.arm64_big_sur.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/six-1.16.0_1.arm64_big_sur.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/protobuf-3.17.3.arm64_big_sur.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/mysql-8.0.25_1.arm64_big_sur.bottle.tar.gz
#=#=#
## 这里报错了,下面自动切换到别的下载路径继续下载了
curl: (22) The requested URL returned error: 404 Warning: Bottle missing, falling back to the default domain...
==> Downloading https://ghcr.io/v2/homebrew/core/mysql/manifests/8.0.25_1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/mysql/blobs/sha256:2e4b10e541bb3bdd076139c13bf6df3f729280c795552dd0d2b4
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:2e4b10e541bb3bdd076139c13bf6df3f729
######################################################################## 100.0%
==> Installing dependencies for mysql: libevent, six and protobuf
==> Installing mysql dependency: libevent
==> Pouring libevent-2.1.12.arm64_big_sur.bottle.tar.gz