[mac m1]brew升级后icu4c跟着升级,导致启动不了mysql、postgresql

报错信息

/opt/homebrew/opt/postgresql@13/bin/postgres

Library not loaded: @loader_path/../../../../opt/icu4c/lib/libicui18n.73.dylib
  Referenced from: <596D404A-9AE9-3B57-B2D6-C141A3878204> /opt/homebrew/Cellar/postgresql@13/13.12/bin/postgres
  Reason: tried: '/usr/local/Cellar/mysql@5.7/5.7.36/bin/libicui18n.73.dylib' (no such file), '/libicui18n.73.dylib' (no such file), '/opt/homebrew/Cellar/postgresql@13/13.12/bin/../../../../opt/icu4c/lib/libicui18n.73.dylib' (no such file), '/usr/local/lib/libicui18n.73.dylib' (no such file), '/usr/lib/libicui18n.73.dylib' (no such file, not in dyld cache)

解决

  • icu4c需要73版本,但是被升级到了74.2
brew info icu4c
==> icu4c: stable 74.2 (bottled) [keg-only]
  • brew search出来的没有 icu4c@73.2这样的就版本,就是最新版
brew search icu4c
==> Formulae
icu4c ✔
  • 找74.2安装位置
find /opt/homebrew -name 'icu4c.rb'
==> /opt/homebrew/Cellar/icu4c/74.2/.brew/icu4c.rb
  • 手动下载旧版本并安装
wget https://github.com/unicode-org/icu/releases/download/release-73-2/icu4c-73_2-src.tgz
tar -zxf icu4c-73_2-src.tgz # 解压到当前目录
cd icu4c/source
./configure --prefix=/opt/homebrew/Cellar/icu4c/73.2 # 指定解压到74.2同目录下的73.2目录
make && make install
  • 软链接到相应位置(根据报错信息调整位置和名字)
sudo ln -sf /opt/homebrew/Cellar/icu4c/73.2/lib/libicui18n.73.2.dylib /usr/local/lib/libicui18n.73.dylib
sudo ln -sf /opt/homebrew/Cellar/icu4c/73.2/lib/libicuuc.73.2.dylib  /usr/local/lib/libicuuc.73.dylib
sudo ln -sf /opt/homebrew/Cellar/icu4c/73.2/lib/libicudata.73.2.dylib /usr/local/lib/libicudata.73.dylib
  • 再重新启动
brew services restart postgresql@13

ps -ef | grep postgres #查看启动了

相关推荐

  1. MacOS 升级14.4.1vscode无法远程连接

    2024-07-11 22:42:03       35 阅读
  2. wpf textbox 有焦点 导致后台更新 前台改变

    2024-07-11 22:42:03       27 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-11 22:42:03       70 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-11 22:42:03       74 阅读
  3. 在Django里面运行非项目文件

    2024-07-11 22:42:03       62 阅读
  4. Python语言-面向对象

    2024-07-11 22:42:03       72 阅读

热门阅读

  1. C语言 会员卡计费系统

    2024-07-11 22:42:03       19 阅读
  2. RKNN3588——利用推理YOLOv8推理图片

    2024-07-11 22:42:03       18 阅读
  3. 如何使用thinkPHP3.2.* 版本开发

    2024-07-11 22:42:03       23 阅读
  4. EasyPOI与Apache POI

    2024-07-11 22:42:03       23 阅读
  5. Go 垃圾回收(GC)

    2024-07-11 22:42:03       24 阅读
  6. ccf认证 202312-3

    2024-07-11 22:42:03       24 阅读
  7. hid-ft260驱动学习笔记 5 - ft260_i2c_probe

    2024-07-11 22:42:03       23 阅读
  8. 使用Ultralytics YOLO进行模型验证

    2024-07-11 22:42:03       26 阅读
  9. 数据库(mysql)忘记密码解决办法

    2024-07-11 22:42:03       23 阅读