报错“dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib”

由于将openssl 1.0.0删除之后,启动mysql报错

dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/bin/mysql
  Reason: image not found

解决办法
1.安装openssl.rb

brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb

安装结果

brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
Updating Homebrew...
######################################################################## 100.0%
Warning: openssl 1.1.1f is available and more recent than version 1.0.2t.
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2t.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring openssl-1.0.2t.mojave.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
  /usr/local/etc/openssl/certs

and run
  /usr/local/opt/openssl/bin/c_rehash

openssl is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.

If you need to have openssl first in your PATH run:
  echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile

For compilers to find openssl you may need to set:
  export LDFLAGS="-L/usr/local/opt/openssl/lib"
  export CPPFLAGS="-I/usr/local/opt/openssl/include"

For pkg-config to find openssl you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"

==> Summary
  /usr/local/Cellar/openssl/1.0.2t: 1,795 files, 12.0MB
Removing: /Users/anne/Library/Caches/Homebrew/openssl--1.0.2t.mojave.bottle.tar.gz... (3.7MB)
(base) Anne:sbin anne$ brew switch openssl 1.0.0
Error: openssl does not have a version "1.0.0" in the Cellar.
openssl's installed versions: 1.0.2t

2.切换openssl版本

brew switch openssl 1.0.2t

切换结果

Cleaning /usr/local/Cellar/openssl/1.0.2t
Opt link created for /usr/local/Cellar/openssl/1.0.2t

成功!

$ mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 111
Server version: 5.6.10 MySQL Community Server (GPL)

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

你可能感兴趣的:(数据库)