PHP笔记网

革命尚未成功,同志仍须努力下载JDK17

作者:Albert.Wen  添加时间:2020-07-28 23:19:37  修改时间:2024-11-14 14:38:05  分类:Linux软件安装/参数优化  编辑

CentOS 7.8 编译安装 MySQL 5.6.49 成功后,执行“初始化数据库”命令行时,报错:

error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory

[root@CentOS7_1 mysql-5.6.49]# /alidata/server/mysql/mysql-5.6/scripts/mysql_install_db \
> --user=mysql \
> --basedir=/alidata/server/mysql/mysql-5.6 \
> --datadir=/alidata/data/mysql \
> --force
/alidata/server/mysql/mysql-5.6/bin/my_print_defaults: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory
Installing MySQL system tables.../alidata/server/mysql/mysql-5.6/bin/mysqld: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory

解决方案:

(1) 在 /etc/ld.so.conf 文件中写入 OpenSSL 库文件的搜索路径(我的是64位的 Centos7.8,所以这里是lib64)

echo "/usr/local/lib64" >> /etc/ld.so.conf

(2) 使修改后的 /etc/ld.so.conf 生效:

ldconfig -v

 

 

参考:

CentOS 7.2 编译安装 openssl,安装完成后输入 openssl version 报错