./mongod: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file

为了支持国产,服务器的操作系统选择了华为的openEuler社区版本操作系统,在安装mongodb时,出现下面的错误:

./mongod: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory

查看当前openssl版本:
./mongod: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file_第1张图片
不知道是不是因为openssl版本太高的原因

根据报错提示,明显是没有在默认的环境中找到libcrypto.so.1.1 库,在/usr/lib64路径下面只找到了libcrypto.so.3.0.8库,很有可能是openssl版本的问题。

解决方法:
在服务器上面全局搜索:libcrypto.so.1.1 库,看看当前环境中是否存在这个库,我发现我安装的mysql包中带了这个库:
find / -name ‘libcrypto.so.1.1’
在这里插入图片描述
既然有这个库,那就好办了,把它创建一下软链到/usr/lib64的路径中

ln -s /usr/local/mysql-8.0/lib/private/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1

重新启动mongodb,又报错,少libssl.so.1.1这个库,同样全局搜索,找到这个库的位置:
在这里插入图片描述
并创建软连接即可。再重新启动就成功了
./mongod: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file_第2张图片

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