在遇到 MySQL 8报错 “error while loading shared libraries: libcrypto.so.3” 时,通常是因为系统找不到所需的 libcrypto.so.3 库文件,libcrypto.so.3 是 OpenSSL 3.0 中的一个库文件,MySQL 8.x 版本和一些 MariaDB 版本可能依赖这个库。
一、错误提示
1 2
[root@server01 ~]# mysql -uroot -p mysql: error while loading shared libraries: libcrypto.so.3: cannot open shared object file: No such file or directory
二、验证 MySQL 是否能正确加载 OpenSSL 库
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
[root@server01 backup]# ldd $(which mysqld) linux-vdso.so.1 => (0x00007ffe60ffe000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fd6fb3f2000) libcrypto.so.3 => not found libssl.so.3 => not found librt.so.1 => /lib64/librt.so.1 (0x00007fd6fb1ea000) libprotobuf-lite.so.3.19.4 => not found libaio.so.1 => /lib64/libaio.so.1 (0x00007fd6fafe8000) libnuma.so.1 => /lib64/libnuma.so.1 (0x00007fd6faddc000) libdl.so.2 => /lib64/libdl.so.2 (0x00007fd6fabd8000) libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fd6fa8d0000) libm.so.6 => /lib64/libm.so.6 (0x00007fd6fa5ce000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fd6fa3b8000) libc.so.6 => /lib64/libc.so.6 (0x00007fd6f9fea000) /lib64/ld-linux-x86-64.so.2 (0x00007fd6fb60e000)
[root@server01 ~]# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 227605 Server version: 8.0.34 MySQL Community Server - GPL
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
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.