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
参考: