brew -v   #查看brew的版本
brew update   #更新homebrew自己,把所有的Formula目录更新,并且会对本机已经安装并有更新的软件用*标明
brew -help  #查看命令帮助:
brew outdated  #查看那些已安装的程序需要更新
brew upgrade [包名]  #更新单个软件:
#例:brew upgrade git
brew upgrade  #更新所有软件:
brew install [包名]@版本  #安装软件
#例:brew install git
brew uninstall [包名]  #卸载
#例:brew uninstall git
brew cleanup   #清理所有包的旧版本 (安装包缓存)
#例:brew cleanup -n  #显示要删除的内容,但不要实际删除任何内容
#例:brew cleanup -s  #清理缓存,包括下载即使是最新的版本
#例:brew cleanup --prune=1     #删除所有早于指定时间的缓存文件(天)
brew cleanup [包名] #清理单个软件旧版本
#例:brew cleanup git 
brew outdated #查看需要更新的包
brew cleanup -n  #查看可清理的旧版本包,不执行实际操作
brew pin $FORMULA  #锁定某个包
brew unpin $FORMULA  #取消锁定
brew info [包名]  #查看包信息
#例:brew info git
brew list  #查看安装列表
brew search [包名] #查询可用包
#例:brew search git
brew deps [包名] #显示包依赖
#例: brew deps git

brew 安装 redis

 ✘ jeffrey@jeffreydeMacBook-Pro  /  brew install redis
==> Fetching redis
==> Downloading https:#ghcr.io/v2/homebrew/core/redis/manifests/7.0.11
######################################################################################################################################################################################################################################################## 100.0%
==> Downloading https:#ghcr.io/v2/homebrew/core/redis/blobs/sha256:d2972b71501b16174b8afffa1625056dfe5c7775d3065568f25f55260e9ea53e
==> Downloading from https:#pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:d2972b71501b16174b8afffa1625056dfe5c7775d3065568f25f55260e9ea53e?se=2023-04-25T11%3A45%3A00Z&sig=n44tfK26mCNrY6a8dysI%2Bxxm%2BG8628FliRRLRwV7Cs8%3D&sp=r&spr=https&sr=b&sv
######################################################################################################################################################################################################################################################## 100.0%
==> Pouring redis--7.0.11.arm64_monterey.bottle.tar.gz
==> Caveats
To restart redis after an upgrade:
  brew services restart redis
Or, if you don't want/need a background service you can just run:
  /opt/homebrew/opt/redis/bin/redis-server /opt/homebrew/etc/redis.conf
==> Summary
🍺  /opt/homebrew/Cellar/redis/7.0.11: 14 files, 2.7MB
==> Running `brew cleanup redis`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

####################################################################################################################################################################################### 操作  ###############################################
# 启动
brew services start redis
# 重启
brew services restart redis
# 暂停
brew services stop redis

brew 安装 mysql

jeffrey@jeffreydeMacBook-Pro  /opt/homebrew/etc   stable  brew install mysql
==> Downloading https://formulae.brew.sh/api/formula.jws.json
#=O#-     #        #
==> Downloading https://formulae.brew.sh/api/cask.jws.json
#=#=-  #       #
==> Fetching dependencies for mysql: icu4c, libevent, libcbor, libfido2, lz4, protobuf, zlib, xz and zstd
==> Fetching icu4c
==> Downloading https://ghcr.io/v2/homebrew/core/icu4c/manifests/72.1
................
................
................
=> Summary
🍺  /opt/homebrew/Cellar/python@3.11/3.11.3: 3,178 files, 62.1MB
==> Running `brew cleanup python@3.11`...
Removing: /opt/homebrew/Cellar/python@3.11/3.11.2_1... (3,178 files, 62.2MB)
==> Checking for dependents of upgraded formulae...
==> No broken dependents found!
==> Caveats
==> mysql
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 -u root

To restart mysql after an upgrade:
  brew services restart mysql
Or, if you don't want/need a background service you can just run:
  /opt/homebrew/opt/mysql/bin/mysqld_safe --datadir=/opt/homebrew/var/mysql
==> python@3.11
Python has been installed as
  /opt/homebrew/bin/python3

Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
`python3`, `python3-config`, `pip3` etc., respectively, have been installed into
  /opt/homebrew/opt/python@3.11/libexec/bin

You can install Python packages with
  pip3 install <package>
They will install into the site-package directory
  /opt/homebrew/lib/python3.11/site-packages

tkinter is no longer included with this formula, but it is available separately:
  brew install python-tk@3.11

gdbm (`dbm.gnu`) is no longer included in this formula, but it is available separately:
  brew install python-gdbm@3.11
`dbm.ndbm` changed database backends in Homebrew Python 3.11.
If you need to read a database from a previous Homebrew Python created via `dbm.ndbm`,
you'll need to read your database using the older version of Homebrew Python and convert to another format.
`dbm` still defaults to `dbm.gnu` when it is installed.

For more information about Homebrew and Python, see: https://docs.brew.sh/Homebrew-and-Python
 jeffrey@jeffreydeMacBook-Pro  /opt/homebrew/etc   stable 
文档更新时间: 2023-12-18 03:25   作者:JeffreyCheung