[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 #查看启动了
相关推荐
廋到被风吹走7 小时前
【数据库】【MySQL】InnoDB外键解析:约束机制、性能影响与最佳实践
android·数据库·mysql
hhhjjjj7 小时前
docker安装postgreSQL
docker·postgresql·容器
Logic1017 小时前
《Mysql数据库应用》 第2版 郭文明 实验6 数据库系统维护核心操作与思路解析
数据库·sql·mysql·学习笔记·计算机网络技术·形考作业·国家开放大学
@nengdoudou8 小时前
KingbaseES支持 mysql 的find_in_set函数
数据库·mysql
梁萌9 小时前
保姆级的MySQL执行计划(Explain)解读
数据库·mysql·explain·执行计划
cq林志炫9 小时前
MySQL 英文逗号隔开的数据如何模糊精确查询
mysql
杨云龙UP10 小时前
MySQL 8.0.x InnoDB 写入链路优化:Redo Log 与 Buffer Pool 扩容与缓冲区调优实战记录-20251029
linux·运维·数据库·sql·mysql
qq_4017004111 小时前
嵌入式Linux网口MAC地址修改
linux·运维·macos
UCoding14 小时前
新能源技术面试 -- 给出一套mysql备份容灾方案
mysql·面试·主从
CodeAmaz14 小时前
MySQL 事务隔离级别详解
数据库·mysql·事务隔离级别