crond: /usr/sbin/sendmail: error while loading shared libraries: libmysqlclient.so.18

2024年 5月 7日 129.7k 0

查看系统日志报错:

crond: /usr/sbin/sendmail: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory

crond: /usr/sbin/sendmail: error while loading shared libraries: libmysqlclient.so.18-1

检查文件是否存在:

[root@yclb ~]# find / -name libmysqlclient.so.18
[root@yclb ~]# ll /usr/lib64/mysql/
total 0
drwxr-xr-x. 2 root root 6 Mar 5 12:43 plugin
对比集群中的另外一台:
[root@ycla ~]# ll /usr/lib64/mysql/
total 3072
lrwxrwxrwx 1 root root 17 Mar 13 15:33 libmysqlclient_r.so -> libmysqlclient.so
lrwxrwxrwx 1 root root 20 Mar 13 15:33 libmysqlclient.so -> libmysqlclient.so.18
lrwxrwxrwx 1 root root 24 Mar 13 15:33 libmysqlclient.so.18 -> libmysqlclient.so.18.0.0
-rwxr-xr-x 1 root root 3135672 Oct 2 2020 libmysqlclient.so.18.0.0
-rwxr-xr-x 1 root root 6758 Oct 2 2020 mysql_config
drwxr-xr-x. 2 root root 54 Mar 13 15:33 plugin
[root@ycla ~]# ll /usr/lib64/mysql/libmysqlclient_r.so
lrwxrwxrwx 1 root root 17 Mar 13 15:33 /usr/lib64/mysql/libmysqlclient_r.so -> libmysqlclient.so
[root@ycla ~]# ll /usr/lib64/mysql/libmysqlclient.so
lrwxrwxrwx 1 root root 20 Mar 13 15:33 /usr/lib64/mysql/libmysqlclient.so -> libmysqlclient.so.18
[root@ycla ~]# ll /usr/lib64/mysql/libmysqlclient.so.18.0.0
-rwxr-xr-x 1 root root 3135672 Oct 2 2020 /usr/lib64/mysql/libmysqlclient.so.18.0.0

很奇怪同样安装mysql的两台怎么不一样。
把好的打包拷贝到缺失的那台:
[root@ycla ~]# cd /usr/lib64/mysql/
[root@ycla mysql]# ll
total 3072
lrwxrwxrwx 1 root root 17 Mar 13 15:33 libmysqlclient_r.so -> libmysqlclient.so
lrwxrwxrwx 1 root root 20 Mar 13 15:33 libmysqlclient.so -> libmysqlclient.so.18
lrwxrwxrwx 1 root root 24 Mar 13 15:33 libmysqlclient.so.18 -> libmysqlclient.so.18.0.0
-rwxr-xr-x 1 root root 3135672 Oct 2 2020 libmysqlclient.so.18.0.0
-rwxr-xr-x 1 root root 6758 Oct 2 2020 mysql_config
drwxr-xr-x. 2 root root 54 Mar 13 15:33 plugin
[root@ycla mysql]# tar cvf m.tar ./*
./libmysqlclient_r.so
./libmysqlclient.so
./libmysqlclient.so.18
./libmysqlclient.so.18.0.0
./mysql_config
./plugin/
./plugin/dialog.so
./plugin/mysql_clear_password.so
[root@ycla mysql]# scp -P 6022 m.tar mqm@yclb:/home/mqm/
Authorized users only. All activity may be monitored and reported
(mqm@yclb) Password:
m.tar 100% 3100KB 78.5MB/s 00:00
[root@ycla mysql]# ll
total 6172
lrwxrwxrwx 1 root root 17 Mar 13 15:33 libmysqlclient_r.so -> libmysqlclient.so
lrwxrwxrwx 1 root root 20 Mar 13 15:33 libmysqlclient.so -> libmysqlclient.so.18
lrwxrwxrwx 1 root root 24 Mar 13 15:33 libmysqlclient.so.18 -> libmysqlclient.so.18.0.0
-rwxr-xr-x 1 root root 3135672 Oct 2 2020 libmysqlclient.so.18.0.0
-rw-r--r-- 1 root root 3174400 May 7 09:32 m.tar
-rwxr-xr-x 1 root root 6758 Oct 2 2020 mysql_config
drwxr-xr-x. 2 root root 54 Mar 13 15:33 plugin
在缺失的主机拷贝解压:
[mqm@yclb ~]$ su - root
Password:
Last login: Tue May 7 09:28:08 CST 2024 on pts/0
Last failed login: Tue May 7 09:33:37 CST 2024 from 10.1.1.52 on ssh:notty
There was 1 failed login attempt since the last successful login.
[root@yclb ~]# mv /home/mqm/m.tar /usr/lib64/mysql/
[root@yclb ~]# cd /usr/lib64/mysql/
[root@yclb mysql]# ll
total 3100
-rw-r--r-- 1 mqm mqm 3174400 May 7 09:34 m.tar
drwxr-xr-x. 2 root root 6 Mar 5 12:43 plugin
[root@yclb mysql]# tar -xvf m.tar
./libmysqlclient_r.so
./libmysqlclient.so
./libmysqlclient.so.18
./libmysqlclient.so.18.0.0
./mysql_config
./plugin/
./plugin/dialog.so
./plugin/mysql_clear_password.so
[root@yclb mysql]# ll
total 6172
lrwxrwxrwx 1 root root 17 Mar 13 15:33 libmysqlclient_r.so -> libmysqlclient.so
lrwxrwxrwx 1 root root 20 Mar 13 15:33 libmysqlclient.so -> libmysqlclient.so.18
lrwxrwxrwx 1 root root 24 Mar 13 15:33 libmysqlclient.so.18 -> libmysqlclient.so.18.0.0
-rwxr-xr-x 1 root root 3135672 Oct 2 2020 libmysqlclient.so.18.0.0
-rw-r--r-- 1 mqm mqm 3174400 May 7 09:34 m.tar
-rwxr-xr-x 1 root root 6758 Oct 2 2020 mysql_config
drwxr-xr-x. 2 root root 54 Mar 13 15:33 plugin
[root@yclb mysql]# /sbin/ldconfig -v
/sbin/ldconfig: Can't stat /libx32: No such file or directory
/sbin/ldconfig: Path `/usr/lib' given more than once
/sbin/ldconfig: Path `/usr/lib64' given more than once
/sbin/ldconfig: Can't stat /usr/libx32: No such file or directory
/usr/lib64//bind9-export:
libisccfg-export.so.160 -> libisccfg-export.so.160.2.1
libisc-export.so.169 -> libisc-export.so.169.0.3
libirs-export.so.160 -> libirs-export.so.160.0.5
libdns-export.so.1102 -> libdns-export.so.1102.1.2
/usr/lib64/dyninst:
libsymtabAPI.so.9.3 -> libsymtabAPI.so.9.3.1
libsymLite.so.9.3 -> libsymLite.so.9.3.1
libstackwalk.so.9.3 -> libstackwalk.so.9.3.1
libpcontrol.so.9.3 -> libpcontrol.so.9.3.1
libpatchAPI.so.9.3 -> libpatchAPI.so.9.3.1
libparseAPI.so.9.3 -> libparseAPI.so.9.3.1
libinstructionAPI.so.9.3 -> libinstructionAPI.so.9.3.1
libdyninstAPI_RT.so.9.3 -> libdyninstAPI_RT.so.9.3.1
libdyninstAPI.so.9.3 -> libdyninstAPI.so.9.3.1
libdynElf.so.9.3 -> libdynElf.so.9.3.1
libdynDwarf.so.9.3 -> libdynDwarf.so.9.3.1
libdynC_API.so.9.3 -> libdynC_API.so.9.3.1
libcommon.so.9.3 -> libcommon.so.9.3.1
/lib:
/lib64:
libopts.so.25 -> libopts.so.25.15.0

对比正常的系统:
crond: /usr/sbin/sendmail: error while loading shared libraries: libmysqlclient.so.18-2
检查对比文件:
crond: /usr/sbin/sendmail: error while loading shared libraries: libmysqlclient.so.18-3
发现缺失mariadb-x86_64.conf,根据上图中正常的内容编辑补充后,重新/sbin/ldconfig -v即可
crond: /usr/sbin/sendmail: error while loading shared libraries: libmysqlclient.so.18-4

询问开发,是否需要sendmail服务?不需要的直接移除处理:

[root@yclb ld.so.conf.d]# which sendmail
/sbin/sendmail
[root@yclb ld.so.conf.d]# which postfix
/sbin/postfix
[root@yclb ld.so.conf.d]# yum remove postfix -y
Loaded plugins: fastestmirror, langpacks
Resolving Dependencies
--> Running transaction check
---> Package postfix.x86_64 2:2.10.1-9.el7 will be erased
--> Finished Dependency Resolution
local | 3.6 kB 00:00:00
prel-release-noarch/7 | 1.5 kB 00:00:00
tools-release-x86_64/7 | 2.9 kB 00:00:00

Dependencies Resolved

==================================================================================================
Package Arch Version Repository Size
==================================================================================================
Removing:
postfix x86_64 2:2.10.1-9.el7 @anaconda 12 M

Transaction Summary
==================================================================================================
Remove 1 Package

Installed size: 12 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Erasing : 2:postfix-2.10.1-9.el7.x86_64 1/1
Verifying : 2:postfix-2.10.1-9.el7.x86_64 1/1

Removed:
postfix.x86_64 2:2.10.1-9.el7

Complete!
[root@yclb ld.so.conf.d]# which postfix
/usr/bin/which: no postfix in (/db/mysql/mysql-8.0.36/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
[root@yclb ld.so.conf.d]# which sendmail
/usr/bin/which: no sendmail in (/db/mysql/mysql-8.0.36/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
[root@yclb ld.so.conf.d]# timed out waiting for input: auto-logout

相关文章

Oracle如何使用授予和撤销权限的语法和示例
Awesome Project: 探索 MatrixOrigin 云原生分布式数据库
下载丨66页PDF,云和恩墨技术通讯(2024年7月刊)
社区版oceanbase安装
Oracle 导出CSV工具-sqluldr2
ETL数据集成丨快速将MySQL数据迁移至Doris数据库

发布评论