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

报错信息

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

ruby 复制代码
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
ruby 复制代码
brew info icu4c
==> icu4c: stable 74.2 (bottled) [keg-only]
  • brew search出来的没有 icu4c@73.2这样的就版本,就是最新版
ruby 复制代码
brew search icu4c
==> Formulae
icu4c ✔
  • 找74.2安装位置
ruby 复制代码
find /opt/homebrew -name 'icu4c.rb'
==> /opt/homebrew/Cellar/icu4c/74.2/.brew/icu4c.rb
  • 手动下载旧版本并安装
ruby 复制代码
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
  • 软链接到相应位置(根据报错信息调整位置和名字)
ruby 复制代码
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
  • 再重新启动
ruby 复制代码
brew services restart postgresql@13

ps -ef | grep postgres #查看启动了
相关推荐
计算机毕设指导67 分钟前
基于SpringBoot的城乡商城协作系统【附源码】
java·spring boot·后端·mysql·spring·tomcat·maven
Smile丶凉轩1 小时前
数据库面试知识点总结
数据库·c++·mysql
RainbowSea2 小时前
9-1. MySQL 性能分析工具的使用——last\_query\_cost,慢查询日志
数据库·sql·mysql
猿java2 小时前
很多程序员会忽略的问题:创建 MySQL索引,需要注意什么?
java·后端·mysql
m0_748248773 小时前
在 Ubuntu 上安装 Nginx 的详细指南
nginx·ubuntu·postgresql
天下皆白_唯我独黑4 小时前
brew Nushell mac升级版本
macos
我爱松子鱼4 小时前
mysql之InnoDB Buffer Pool 深度解析与性能优化
android·mysql·性能优化
刘什么洋啊Zz8 小时前
MacOS下使用Ollama本地构建DeepSeek并使用本地Dify构建AI应用
人工智能·macos·ai·ollama·deepseek
goodmao8 小时前
【DeepSeek】-macOS本地终端部署后运行DeepSeek如何分析图片
gpt·macos·大模型·ollama·deepseek·本地图片分析
知初~9 小时前
出行项目案例
hive·hadoop·redis·sql·mysql·spark·database