Mac M1芯片安装 MySQL

考虑到目前生产环境大都用5.x,所以这里我选择MySQL 5.7版本,而非新的MySQL 8.X版本

1、安装环境和安装时间

安装环境:2021款M1MacBookPro,macOS Monterey 12系统 Apple M1芯片
安装时间:2021年11月20日

在这里插入图片描述

2、使用brew安装MySQL

2.1 第一次失败

➜  ~ brew install mysql@5.7
Error: Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local)!
Please create a new installation in /opt/homebrew using one of the
"Alternative Installs" from:
  https://docs.brew.sh/Installation
You can migrate your previously installed formula list with:
  brew bundle dump
➜  ~

2.2 根据提示执行命令,第1次失败,第2次开启VPN再次执行,终于成功

# # 第1次执行,失败

➜  ~ brew bundle dump
==> Tapping homebrew/bundle
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-bundle'...
fatal: unable to access 'https://github.com/Homebrew/homebrew-bundle/': LibreSSL SSL_connect: Operation timed out in connection to github.com:443
Error: Failure while executing; `git clone https://github.com/Homebrew/homebrew-bundle /usr/local/Homebrew/Library/Taps/homebrew/homebrew-bundle --origin=origin --template=` exited with 128.
Error: Failure while executing; `/usr/local/bin/brew tap homebrew/bundle` exited with 1.

# 第2次执行,成功
➜  ~ brew bundle dump
==> Tapping homebrew/bundle
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-bundle'...
remote: Enumerating objects: 6321, done.
remote: Counting objects: 100% (499/499), done.
remote: Compressing objects: 100% (314/314), done.
remote: Total 6321 (delta 231), reused 403 (delta 182), pack-reused 5822
Receiving objects: 100% (6321/6321), 1.47 MiB | 3.44 MiB/s, done.
Resolving deltas: 100% (3654/3654), done.
Tapped 1 command (98 files, 1.8MB).
➜  ~

2.3 执行如下命令(VPN开/关都试过均失败)

# 1. 失败😔😔

➜  ~ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
curl: (7) Failed to connect to raw.githubusercontent.com port 443 after 3 ms: Connection refused

# 2. 更换命令后重新执行

➜  ~ /usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)"
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin21/rbconfig.rb:230: warning: Insecure world writable dir /Users/able/Documents/Java/Tools/Maven/apache-maven-3.3.9/bin in PATH, mode 040777
Warning: Ruby版本Homebrew安装脚本已被废弃,新版脚本使用Bash重写。
请使用以下命令:
  /bin/bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install.sh)"

==> Checking for `sudo` access (which may request your password).
Password:
==> This script will install:
/opt/homebrew/bin/brew
/opt/homebrew/share/doc/homebrew
/opt/homebrew/share/man/man1/brew.1
/opt/homebrew/share/zsh/site-functions/_brew
/opt/homebrew/etc/bash_completion.d/brew
/opt/homebrew
==> The following new directories will be created:

。。。省略。。。
。。。省略。。。
请按回车键(RETURN)继续安装,按其他任意按键取消安装
➜  ~

# 3. 我这里果断选择了取消,按照👆提示使用新命令重新执行
/bin/bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install.sh)"

2.4 再次按照提示安装

➜  ~ /bin/bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install.sh)"
==> Checking for `sudo` access (which may request your password).
Password:
==> This script will install:
/opt/homebrew/bin/brew
/opt/homebrew/share/doc/homebrew
/opt/homebrew/share/man/man1/brew.1
/opt/homebrew/share/zsh/site-functions/_brew
/opt/homebrew/etc/bash_completion.d/brew
/opt/homebrew
==> The following new directories will be created:
/opt/homebrew/bin
/opt/homebrew/etc
/opt/homebrew/include
/opt/homebrew/lib
/opt/homebrew/sbin
/opt/homebrew/share
/opt/homebrew/var
/opt/homebrew/opt
/opt/homebrew/share/zsh
/opt/homebrew/share/zsh/site-functions
/opt/homebrew/var/homebrew
/opt/homebrew/var/homebrew/linked
/opt/homebrew/Cellar
/opt/homebrew/Caskroom
/opt/homebrew/Frameworks
==> 安装提示
中文安装教程(建议收藏):https://brew.idayer.com/
如果你想换源,可以使用镜像助手:https://brew.idayer.com/guide/change-source/

安装遇到问题,可以通过讨论群寻求帮助。
也欢迎加群讨论,扫码关注公众号(湖中剑),回复'brew'加入讨论群。

█████████████████████████████████████
█████████████████████████████████████
████ ▄▄▄▄▄ █▀█ █▄▀▄ ▄ ▄▄██ ▄▄▄▄▄ ████
████ █   █ █▀▀▀█ ▀█▀▀▀▀▄▀█ █   █ ████
████ █▄▄▄█ █▀ █▀▀█▄▀ █▀▄ █ █▄▄▄█ ████
████▄▄▄▄▄▄▄█▄▀ ▀▄█▄▀ █▄▀ █▄▄▄▄▄▄▄████
████     ▀▄▄▄▄▀▄▀▄▄█▀▀█ █ ▀ ▀▄█▄▀████
████ ▀█▄▀▀▄  █▄█▀█ ▄██ █ ▀ ▄▄██▀█████
████ █   █▄ ▄ ▄█▄ ▀  ██ ▀ ▀▀▀▄ █▀████
████ ██▄██▄▀ █  ▄█▀ ▄▄▀▀ ▀ █▄█▄▀█████
████ ▄ ▀▄▄▄▀█▄ ▄▀     ▀ ▀█▀ ▀▀ █▀████
████ █ ▀▀▀▄█▄█▄█▀█▀▄ █▀▀▄▄█▄▄▄▄▀█████
████▄██▄▄█▄█▀▀▀█▄█▄ ▀▄▀█ ▄▄▄ ▀   ████
████ ▄▄▄▄▄ █▄▀  ▄█▄  ▄▀  █▄█  ▄▀█████
████ █   █ █ ▀▄▄ ▀▄ ▀███ ▄▄▄▄ ▄▀ ████
████ █▄▄▄█ █ ▄▄▀ ██▄▀▄▀▄ ▀▄   ▄ █████
████▄▄▄▄▄▄▄█▄▄█▄▄████▄█████▄▄█▄██████
█████████████████████████████████████
█████████████████████████████████████


请按回车键(RETURN)继续安装,按其他任意按键取消安装
==> /usr/bin/sudo /bin/mkdir -p /opt/homebrew
==> /usr/bin/sudo /usr/sbin/chown root:wheel /opt/homebrew
==> /usr/bin/sudo /bin/mkdir -p /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks
==> /usr/bin/sudo /bin/chmod u=rwx,g=rwx /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks
==> /usr/bin/sudo /bin/chmod g-w,o-w /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions
==> /usr/bin/sudo /usr/sbin/chown able /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks
==> /usr/bin/sudo /usr/bin/chgrp admin /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks
==> /usr/bin/sudo /usr/sbin/chown -R able:admin /opt/homebrew
==> Downloading and installing Homebrew...
remote: Enumerating objects: 197481, done.
remote: Counting objects: 100% (197481/197481), done.
remote: Compressing objects: 100% (45950/45950), done.
remote: Total 197481 (delta 146750), reused 197360 (delta 146703)
接收对象中: 100% (197481/197481), 52.25 MiB | 11.04 MiB/s, 完成.
处理 delta 中: 100% (146750/146750), 完成.
来自 https://mirrors.ustc.edu.cn/brew
 * [新分支]          master     -> origin/master
 * [新标签]              0.1        -> 0.1
 * [新标签]              0.2        -> 0.2
。。。省略。。。
。。。省略。。。
 * [新标签]              3.3.4      -> 3.3.4
remote: Enumerating objects: 7531, done.
remote: Counting objects: 100% (7531/7531), done.
remote: Compressing objects: 100% (1581/1581), done.
remote: Total 7531 (delta 5798), reused 7531 (delta 5798)
接收对象中: 100% (7531/7531), 1.61 MiB | 9.33 MiB/s, 完成.
处理 delta 中: 100% (5798/5798), 完成 737 个本地对象.
来自 https://mirrors.ustc.edu.cn/brew
 * [新标签]              1.1.0.1                           -> 1.1.0.1
 * [新标签]              1.1.2.1                           -> 1.1.2.1
 * [新标签]              1.2.7                             -> 1.2.7
 * [新标签]              1.2.8                             -> 1.2.8
 * [新标签]              backup/activesupport-23-38-09     -> backup/activesupport-23-38-09
 * [新标签]              backup/brew-cask-style-14-54-55   -> backup/brew-cask-style-14-54-55
 * [新标签]              backup/create-cache-00-29-47      -> backup/create-cache-00-29-47
 * [新标签]              backup/days-03-02-52              -> backup/days-03-02-52
 * [新标签]              backup/days-03-02-59              -> backup/days-03-02-59
 * [新标签]              backup/days-19-30-23              -> backup/days-19-30-23
 * [新标签]              backup/gpg-verification-01-53-16  -> backup/gpg-verification-01-53-16
 * [新标签]              backup/remove-popen-read-19-56-50 -> backup/remove-popen-read-19-56-50
 * [新标签]              backup/remove-popen-read-20-00-21 -> backup/remove-popen-read-20-00-21
HEAD 现在位于 27a76295a Merge pull request #12279 from bayandin/synced-versions-formulae
==> Tapping homebrew/core
remote: Enumerating objects: 1096372, done.
remote: Total 1096372 (delta 0), reused 0 (delta 0)
接收对象中: 100% (1096372/1096372), 449.59 MiB | 8.45 MiB/s, 完成.
处理 delta 中: 100% (761972/761972), 完成.
来自 https://mirrors.ustc.edu.cn/homebrew-core
 * [新分支]          master     -> origin/master
HEAD 现在位于 cdb7b8a636b dxpy: update 0.316.0 bottle.
HOMEBREW_BREW_GIT_REMOTE set: using https://mirrors.ustc.edu.cn/brew.git for Homebrew/brew Git remote.
HOMEBREW_CORE_GIT_REMOTE set: using https://mirrors.ustc.edu.cn/homebrew-core.git for Homebrew/core Git remote.
Warning: !!!!!!!!!!! 重要  !!!!!!!!!!!!!!!
Warning: 看到此提示,一定要执行 Next steps 中的 环境变量设置!!!
Warning: /opt/homebrew/bin is not in your PATH.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics
No analytics data has been sent yet (or will be during this `install` run).

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations

==> Next steps:
Warning: !!!!!!!!!!! 重要  !!!!!!!!!!!!!!!
切记执行环境变量设置!,如已执行过请忽略。
- 执行下面命令将 Homebrew 到 PATH 中:
    echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/able/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"
  如有疑问,可以访问 https://brew.idayer.com/guide/m1/
- 🎉 恭喜,安装成功!运行 `brew help` 开始体验吧
- 更多文档:
    https://docs.brew.sh
    https://brew.idayer.com

# 按照提示执行如下命令❤️##########################################

➜  ~ echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/able/.zprofile
➜  ~ eval "$(/opt/homebrew/bin/brew shellenv)"
➜  ~

2.5 上述步骤安装成功后,编辑vim ~/.zshrc

# 编辑
vim ~/.zshrc

# 添加如下
export PATH=/opt/homebrew/bin:$PATH

# 最后更新配置
source ~/.zshrc

2.6 再次安装MySQL–5.7.36.arm64,成功🎉🎉

➜  ~ brew install mysql@5.7
==> Downloading https://ghcr.io/v2/homebrew/core/ca-certificates/manifests/2021-10-26
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/ca-certificates/blobs/sha256:1bbd45c16a0b9912174c553a6d7ae1b67b11abbeb3155eaf03109bb62d8e5381
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:1bbd45c16a0b9912174c553a6d7ae1b67b11abbeb3155eaf03109bb62d8e5381?se=2021-11-19T19%3A20%3A00Z&sig=YV2WZmrg7Y8%2BBqjj7wSpM4iTdi6LJRyCWiUoxA8FWic%3D&sp=r&spr=https
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/1.1/manifests/1.1.1l_1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/1.1/blobs/sha256:8f5b0bee61c1570b9f0fc0a21d6c322e904ae7975bdaada5787451d18e9677a6
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:8f5b0bee61c1570b9f0fc0a21d6c322e904ae7975bdaada5787451d18e9677a6?se=2021-11-19T19%3A20%3A00Z&sig=rNOAwBwDZASv%2F7jIhWjs4SmMJwqLWg6FHzMIPv3zULE%3D&sp=r&spr=https
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/mysql/5.7/manifests/5.7.36
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/mysql/5.7/blobs/sha256:e23df0f6e8bfc83fe2e982ec60e89be6ca069d35f96981ea6073591563bf7917
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:e23df0f6e8bfc83fe2e982ec60e89be6ca069d35f96981ea6073591563bf7917?se=2021-11-19T19%3A20%3A00Z&sig=hHHMGyBxYIbP0aCUj9%2BWQ1WQK%2B2j9FdIcyiAw%2Bjc53Y%3D&sp=r&spr=h
######################################################################## 100.0%
==> Installing dependencies for mysql@5.7: ca-certificates and openssl@1.1
==> Installing mysql@5.7 dependency: ca-certificates
==> Pouring ca-certificates--2021-10-26.all.bottle.tar.gz
==> Regenerating CA certificate bundle from keychain, this may take a while...
🍺  /opt/homebrew/Cellar/ca-certificates/2021-10-26: 3 files, 208.5KB
==> Installing mysql@5.7 dependency: openssl@1.1
==> Pouring openssl@1.1--1.1.1l_1.arm64_monterey.bottle.tar.gz
🍺  /opt/homebrew/Cellar/openssl@1.1/1.1.1l_1: 8,073 files, 18MB
==> Installing mysql@5.7
==> Pouring mysql@5.7--5.7.36.arm64_big_sur.bottle.tar.gz
==> /opt/homebrew/Cellar/mysql@5.7/5.7.36/bin/mysqld --initialize-insecure --user=able --basedir=/opt/homebrew/Cellar/mysql@5.7/5.7.36 --datadir=/opt/homebrew/var/mysql --tmpdir=/tmp
==> Caveats
We've installed your MySQL database without a root password. To secure it run:
    mysql_secure_installation

MySQL is configured to only allow connections from localhost by default

To connect run:
    mysql -uroot

mysql@5.7 is keg-only, which means it was not symlinked into /opt/homebrew,
because this is an alternate version of another formula.

If you need to have mysql@5.7 first in your PATH, run:
  echo 'export PATH="/opt/homebrew/opt/mysql@5.7/bin:$PATH"' >> ~/.zshrc

For compilers to find mysql@5.7 you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/mysql@5.7/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/mysql@5.7/include"


To restart mysql@5.7 after an upgrade:
  brew services restart mysql@5.7
Or, if you don't want/need a background service you can just run:
  /opt/homebrew/opt/mysql@5.7/bin/mysqld_safe --datadir=/opt/homebrew/var/mysql
==> Summary
🍺  /opt/homebrew/Cellar/mysql@5.7/5.7.36: 320 files, 233.3MB
==> Caveats
==> mysql@5.7
We've installed your MySQL database without a root password. To secure it run:
    mysql_secure_installation

MySQL is configured to only allow connections from localhost by default

To connect run:
    mysql -uroot

mysql@5.7 is keg-only, which means it was not symlinked into /opt/homebrew,
because this is an alternate version of another formula.

If you need to have mysql@5.7 first in your PATH, run:
  echo 'export PATH="/opt/homebrew/opt/mysql@5.7/bin:$PATH"' >> ~/.zshrc

For compilers to find mysql@5.7 you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/mysql@5.7/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/mysql@5.7/include"


To restart mysql@5.7 after an upgrade:
  brew services restart mysql@5.7
Or, if you don't want/need a background service you can just run:
  /opt/homebrew/opt/mysql@5.7/bin/mysqld_safe --datadir=/opt/homebrew/var/mysql

➜  ~ 

2.7 配置环境变量

# ##################按照上面👆安装提示执行如下👇命令#################

echo 'export PATH="/opt/homebrew/opt/mysql@5.7/bin:$PATH"' >> ~/.zshrc

# 编辑
vim ~/.zshrc

# 根据安装提示,添加如下配置
export LDFLAGS="-L/opt/homebrew/opt/mysql@5.7/lib"
export CPPFLAGS="-I/opt/homebrew/opt/mysql@5.7/include"

# 最后更新配置
source ~/.zshrc

2.8 查看版本

➜  ~ mysql --version
mysql  Ver 14.14 Distrib 5.7.36, for osx10.16 (x86_64) using  EditLine wrapper

2.9 根据安装👆提示,初始化,第1次失败😔😔

任意路径执行命令:mysql_secure_installation,交互过程中不断输入y或者n,可以修改密码。

➜  ~ mysql.server status
 ERROR! MySQL is not running

# 初始化,失败!!
➜  ~ mysql_secure_installation

Securing the MySQL server deployment.

Enter password for user root:
Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

# ❤️找到👆安装日志,根据提示操作,启动成功

➜  ~ brew services restart mysql@5.7

==> Tapping homebrew/services
Cloning into '/opt/homebrew/Library/Taps/homebrew/homebrew-services'...
remote: Enumerating objects: 1529, done.
remote: Counting objects: 100% (408/408), done.
remote: Compressing objects: 100% (297/297), done.
remote: Total 1529 (delta 169), reused 284 (delta 101), pack-reused 1121
Receiving objects: 100% (1529/1529), 447.19 KiB | 1.45 MiB/s, done.
Resolving deltas: 100% (645/645), done.
Tapped 1 command (38 files, 557KB).
==> Successfully ran `mysql@5.7` (label: homebrew.mxcl.mysql@5.7)


# 查看MySQL启动状态

➜  ~ mysql.server status
 SUCCESS! MySQL running (62019)
2.9.1 继续初始化,第2次成功🎉🎉
➜  ~ mysql_secure_installation

Securing the MySQL server deployment.

Connecting to MySQL using a blank password.

VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?

Press y|Y for Yes, any other key for No: no   # Setp1:如果选yes的话密码长度就必须要设置为8位以上,我只想要6位的
Please set the password for root here.

New password: 123456    # Step2:为root设置密码

Re-enter new password:  # Step3:再次输入上面👆密码 123456
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.  # Step4:移除不用密码的那个账户


Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : no    # Step5:拒绝root远程登录

 ... skipping.
By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.


Remove test database and access to it? (Press y|Y for Yes, any other key for No) : yes      # Step6:删除text数据库,对我来说没什么用,酌情删/留
 - Dropping test database...
Success.

 - Removing privileges on test database...
Success.

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : yes    # Step7:yes重新加载权限表将确保所有更改
Success.

All done!   # 成功🎉🎉🎉🎉🎉🎉

3、MySQL 常用命令

命令说明
查看MySQL状态mysql.server status
启动MySQLmysql.server start
停止MySQLmysql.server stop
重启MySQLmysql.server restart

3.2 使用brew管理安装的服务,如Mysql、Nginx、Redis等

brew services 用于管理使用brew安装的服务,如Mysql、Nginx、Redis等
命令说明
brew services list查看服务与运行状态
brew services start mysql开启mysql服务
brew services stop mysql停止mysql服务
brew services restart mysql重起mysql服务
------------------------------------------------
brew services start --all开启所有服务
brew services stop --all停止所有服务
brew services restart --all重起所有服务

4、查看mysql进程 ps -ef | grep mysql

➜  ~ ps -ef | grep mysql
  501 76120     1   0  4:09上午 ??         0:00.02 /bin/sh /opt/homebrew/opt/mysql@5.7/bin/mysqld_safe --datadir=/opt/homebrew/var/mysql
  501 76208 76120   0  4:09上午 ??         0:00.18 /opt/homebrew/opt/mysql@5.7/bin/mysqld --basedir=/opt/homebrew/opt/mysql@5.7 --datadir=/opt/homebrew/var/mysql --plugin-dir=/opt/homebrew/opt/mysql@5.7/lib/plugin --log-error=Able-MacBook-Pro.local.err --pid-file=Able-MacBook-Pro.local.pid
  501 76220     1   0  4:09上午 ttys001    0:00.01 /bin/sh /opt/homebrew/Cellar/mysql@5.7/5.7.36/bin/mysqld_safe --datadir=/opt/homebrew/var/mysql --pid-file=/opt/homebrew/var/mysql/Able-MacBook-Pro.local.pid
  501 76319 76220   0  4:09上午 ttys001    0:00.16 /opt/homebrew/Cellar/mysql@5.7/5.7.36/bin/mysqld --basedir=/opt/homebrew/Cellar/mysql@5.7/5.7.36 --datadir=/opt/homebrew/var/mysql --plugin-dir=/opt/homebrew/Cellar/mysql@5.7/5.7.36/lib/plugin --log-error=Able-MacBook-Pro.local.err --pid-file=/opt/homebrew/var/mysql/Able-MacBook-Pro.local.pid
  501 76609 75348   0  4:10上午 ttys001    0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox mysql
➜  ~

5、Navicat 测试连接,Success!!

在这里插入图片描述
最后喜欢的小伙伴,记得关注收藏哦!😏🍭😘

  • 2
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值