[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/[email protected]/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]
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 #查看启动了
相关推荐
爱喝酸奶的桃酥8 分钟前
MYSQL数据库集群高可用和数据监控平台
java·数据库·mysql
数据库幼崽27 分钟前
MySQL 8.0 OCP 1Z0-908 61-70题
数据库·mysql·ocp
进击的CJR27 分钟前
MySQL 8.0 OCP 英文题库解析(四)
mysql
神仙别闹1 小时前
基于C#+MySQL实现(WinForm)企业设备使用信息管理系统
开发语言·mysql·c#
528303 小时前
MySQL主从复制
数据库·mysql
@解忧杂货铺4 小时前
MySQL历史版本下载及安装配置教程
数据库·mysql
dgiij5 小时前
excel大表导入数据库
数据库·mysql·node.js·excel
多敲代码防脱发5 小时前
导出导入Excel文件(详解-基于EasyExcel)
java·开发语言·jvm·数据库·mysql·excel
风筝超冷5 小时前
获取高德地图JS API的安全密钥和Key的方法
服务器·mysql·js api
数据库幼崽5 小时前
MySQL 8.0 OCP 1Z0-908 51-60题
数据库·mysql·ocp