Postfix 加载共享库时出错:libmysqlclient.so.18

Postfix 加载共享库时出错:libmysqlclient.so.18

当我尝试启动 postfix 时,出现以下错误:

/usr/sbin/postconf: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such...r directory
/usr/bin/newaliases: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No suc...r directory
/usr/sbin/postfix: error while loading shared libraries: libmysqlclient.so.18:  cannot open shared object file: No suc...r directory

在我安装 mysql 之前,Postfix 可以正常工作。我不确定为什么 mysql 与 Postfix 错误有关。

当我运行find . -name 'libmysqlclient*'命令时,我得到以下信息:

./usr/lib64/mysql/libmysqlclient.so.21
./usr/lib64/mysql/libmysqlclient.so.21.2.30

# ls -al /usr/lib64/mysql
total 7520
drwxr-xr-x.  5 root root     109 Sep 29 13:47 .
dr-xr-xr-x. 49 root root   28672 Sep 29 13:49 ..
lrwxrwxrwx.  1 root root      25 Sep 28 21:53 libmysqlclient.so.21 -> libmysqlclient.so.21.2.30
-rwxr-xr-x.  1 root root 7651120 Jul  6 17:53 libmysqlclient.so.21.2.30
drwxr-xr-x.  4 root root      28 Sep 28 21:53 mecab
drwxr-xr-x.  2 root root    4096 Sep 28 21:53 plugin
drwxr-xr-x.  3 root root     131 Sep 28 21:53 private

没有安装 18 版本,我很困惑为什么它要寻找 18 而不是 21。

我有帮助的更多信息:

mysql-community-server-8.0.30-1.el7.x86_64
#which mysql: /bin/mysql/mysql  
#mysql -V: Ver 8.0.30 for Linux on x86_64 (MySQL Community Server - GPL)
#mysqld -V: /usr/sbin/mysqld  Ver 8.0.30 for Linux on x86_64 (MySQL Community Server - GPL)
#php -v PHP 8.0.20 (cli)
#systemctl status mysqld: Active: active (running) since Fri 2022-09-30 23:27:02 CDT; 3 days ago
# rpm -qa postfix: postfix-2.10.1-6.amzn2.0.3.x86_64
AWS Linux 2 Server

谁能帮我这个?我在这里检查了与我的问题类似的其他帖子,但是,我无法找到与我的情况足够接近的解决方案,我可以尝试。

最后,我还运行了这个命令,它输出了大量信息,这就是我将其保存在本文末尾的原因:

# repoquery --whatprovides *libmysqlclient*

mysql-community-libs-0:8.0.18-1.el7.i686
mysql-community-libs-0:8.0.11-1.el7.i686
mysql-community-devel-0:8.0.11-1.el7.i686
mysql-community-libs-0:8.0.27-1.el7.i686
mysql-community-libs-compat-0:8.0.15-1.el7.i686
mysql-community-libs-0:8.0.27-1.el7.x86_64
mysql-community-devel-0:8.0.17-1.el7.i686
mysql-workbench-community-0:6.3.5-1.el7.x86_64
mysql-community-libs-0:8.0.30-1.el7.i686
mysql-community-devel-0:8.0.15-1.el7.x86_64
mysql-community-libs-compat-0:8.0.24-1.el7.i686
mysql-community-libs-compat-0:8.0.26-1.el7.i686
mysql-workbench-community-0:8.0.16-1.el7.x86_64
mysql-community-libs-0:8.0.26-1.el7.i686
mysql-community-libs-0:8.0.17-1.el7.i686
mysql-workbench-community-0:8.0.12-1.el7.x86_64
mysql-community-devel-0:8.0.21-1.el7.i686
mysql-community-libs-compat-0:8.0.13-1.el7.i686
mysql-community-libs-compat-0:8.0.16-2.el7.i686
mariadb-devel-1:5.5.60-1.amzn2.x86_64
mysql-community-devel-0:8.0.16-2.el7.i686
mysql-community-devel-0:8.0.19-1.el7.x86_64
mysql-community-devel-0:8.0.18-1.el7.x86_64
mysql-community-libs-0:8.0.16-2.el7.i686
mysql-community-libs-compat-0:8.0.22-1.el7.i686
mariadb-devel-1:5.5.56-2.amzn2.0.2.x86_64
mysql-community-libs-0:8.0.16-2.el7.x86_64
mysql-community-devel-0:8.0.26-1.el7.i686
mysql-community-libs-0:8.0.22-1.el7.x86_64
mysql-community-libs-0:8.0.28-1.el7.x86_64
mysql-community-libs-0:8.0.23-1.el7.x86_64
mysql-community-devel-0:8.0.30-1.el7.i686
mysql-community-devel-0:8.0.26-1.el7.x86_64
mysql-community-libs-compat-0:8.0.19-1.el7.i686
mysql-community-devel-0:8.0.11-1.el7.x86_64
mysql-community-libs-0:8.0.13-1.el7.i686
mysql-community-libs-compat-0:8.0.12-1.el7.i686
mariadb-devel-1:5.5.62-1.amzn2.0.1.x86_64
mysql-workbench-community-0:8.0.22-1.el7.x86_64
mysql-community-devel-0:8.0.15-1.el7.i686
mysql-community-devel-0:8.0.12-1.el7.x86_64
mysql-community-devel-0:8.0.12-1.el7.i686
mysql-workbench-community-0:6.2.4-1.el7.x86_64
mysql-community-devel-0:8.0.23-1.el7.i686
mariadb-libs-1:5.5.62-1.amzn2.0.1.i686
mysql-community-devel-0:8.0.16-1.el7.i686
mysql-community-libs-compat-0:8.0.25-1.el7.x86_64
mysql-community-libs-compat-0:8.0.21-1.el7.i686
mysql-community-libs-0:8.0.21-1.el7.x86_64
mysql-workbench-community-0:8.0.13-1.el7.x86_64
mysql-community-libs-compat-0:8.0.14-1.el7.x86_64
mysql-community-libs-compat-0:8.0.27-1.el7.x86_64
mysql-community-libs-compat-0:8.0.30-1.el7.i686
mysql-community-libs-compat-0:8.0.23-1.el7.i686
mysql-community-devel-0:8.0.14-1.el7.x86_64
mariadb-devel-1:5.5.56-2.amzn2.x86_64
mysql-community-libs-0:8.0.17-1.el7.x86_64
mysql-community-devel-0:8.0.22-1.el7.i686
mysql-community-libs-0:8.0.20-1.el7.i686
mariadb-libs-1:5.5.68-1.amzn2.i686
mysql-community-libs-0:8.0.25-1.el7.i686
mariadb-libs-1:5.5.56-2.amzn2.x86_64
mysql-community-libs-0:8.0.16-1.el7.i686
mysql-community-libs-compat-0:8.0.14-1.el7.i686
mariadb-libs-1:5.5.68-1.amzn2.x86_64
mysql-community-libs-compat-0:8.0.19-1.el7.x86_64
mysql-community-libs-0:8.0.12-1.el7.i686
mysql-workbench-community-0:6.3.6-1.el7.x86_64
mysql-workbench-community-0:6.3.7-1.el7.x86_64
mysql-community-libs-0:8.0.11-1.el7.x86_64
mysql-community-libs-compat-0:8.0.25-1.el7.i686
mysql-community-libs-0:8.0.20-1.el7.x86_64
mariadb-libs-1:5.5.60-1.amzn2.i686
mysql-community-libs-compat-0:8.0.30-1.el7.x86_64
mysql-community-libs-compat-0:8.0.11-1.el7.i686
mysql-community-libs-0:8.0.25-1.el7.x86_64
mariadb-devel-1:5.5.68-1.amzn2.x86_64
mysql-community-devel-0:8.0.22-1.el7.x86_64
mariadb-libs-1:5.5.56-2.amzn2.0.2.i686
mysql-community-libs-compat-0:8.0.21-1.el7.x86_64
mysql-community-libs-compat-0:8.0.18-1.el7.x86_64
mysql-community-devel-0:8.0.28-1.el7.i686
mariadb-libs-1:5.5.62-1.amzn2.0.1.x86_64
mysql-community-libs-compat-0:8.0.24-1.el7.x86_64
mysql-community-devel-0:8.0.28-1.el7.x86_64
mysql-community-libs-compat-0:8.0.18-1.el7.i686
mysql-community-libs-0:8.0.19-1.el7.i686
mysql-community-libs-0:8.0.15-1.el7.x86_64
mysql-community-devel-0:8.0.19-1.el7.i686
mysql-community-libs-0:8.0.28-1.el7.i686
mariadb-libs-1:5.5.64-1.amzn2.x86_64
mysql-workbench-community-0:6.2.5-1.el7.x86_64
mysql-community-libs-compat-0:8.0.16-1.el7.x86_64
mysql-community-libs-compat-0:8.0.28-1.el7.x86_64
mariadb-libs-1:5.5.60-1.amzn2.x86_64
mysql-workbench-community-0:8.0.14-1.el7.x86_64
mysql-workbench-community-0:8.0.15-1.el7.x86_64
mysql-community-libs-0:8.0.21-1.el7.i686
mysql-community-devel-0:8.0.23-1.el7.x86_64
mysql-community-libs-compat-0:8.0.11-1.el7.x86_64
mysql-workbench-community-0:6.3.4-1.el7.x86_64
mysql-workbench-community-0:6.2.3-1.el7.x86_64
mariadb-devel-1:5.5.64-1.amzn2.x86_64
mysql-community-devel-0:8.0.24-1.el7.x86_64
mysql-community-libs-0:8.0.23-1.el7.i686
mysql-workbench-community-0:6.3.3-1.el7.x86_64
mysql-community-devel-0:8.0.25-1.el7.i686
mysql-workbench-community-0:8.0.18-1.el7.x86_64
mysql-community-devel-0:8.0.20-1.el7.i686
mariadb-libs-1:5.5.64-1.amzn2.i686
mysql-community-libs-compat-0:8.0.23-1.el7.x86_64
mysql-community-devel-0:8.0.16-2.el7.x86_64
mysql-community-libs-0:8.0.14-1.el7.i686
mysql-community-libs-0:8.0.19-1.el7.x86_64
mysql-community-libs-compat-0:8.0.12-1.el7.x86_64
mysql-community-libs-compat-0:8.0.13-1.el7.x86_64
mysql-community-devel-0:8.0.17-1.el7.x86_64
mysql-community-devel-0:8.0.27-1.el7.x86_64
mysql-workbench-community-0:8.0.21-1.el7.x86_64
mysql-community-libs-0:8.0.22-1.el7.i686
mysql-community-devel-0:8.0.13-1.el7.x86_64
mysql-community-libs-compat-0:8.0.26-1.el7.x86_64
mysql-workbench-community-0:6.3.6-2.el7.x86_64
mysql-workbench-community-0:6.3.8-1.el7.x86_64
mysql-community-libs-0:8.0.24-1.el7.x86_64
mysql-community-libs-compat-0:8.0.16-1.el7.i686
mysql-community-libs-compat-0:8.0.17-1.el7.i686
mysql-community-libs-compat-0:8.0.22-1.el7.x86_64
mysql-community-libs-0:8.0.30-1.el7.x86_64
mysql-community-libs-compat-0:8.0.28-1.el7.i686
mysql-community-devel-0:8.0.27-1.el7.i686
mysql-community-libs-compat-0:8.0.15-1.el7.x86_64
mysql-community-devel-0:8.0.25-1.el7.x86_64
mysql-community-devel-0:8.0.18-1.el7.i686
mysql-community-libs-0:8.0.18-1.el7.x86_64
mysql-community-devel-0:8.0.16-1.el7.x86_64
mysql-community-libs-0:8.0.26-1.el7.x86_64
mysql-workbench-community-0:8.0.20-1.el7.x86_64
mysql-community-libs-0:8.0.12-1.el7.x86_64
mysql-community-libs-0:8.0.15-1.el7.i686
mysql-workbench-community-0:8.0.19-1.el7.x86_64
mysql-community-devel-0:8.0.30-1.el7.x86_64
mysql-community-libs-compat-0:8.0.17-1.el7.x86_64
mysql-community-libs-compat-0:8.0.20-1.el7.i686
mysql-community-libs-0:8.0.14-1.el7.x86_64
mysql-community-libs-compat-0:8.0.20-1.el7.x86_64
mysql-community-libs-0:8.0.24-1.el7.i686
mysql-community-devel-0:8.0.14-1.el7.i686
mysql-community-devel-0:8.0.13-1.el7.i686
mysql-community-libs-compat-0:8.0.16-2.el7.x86_64
mysql-community-devel-0:8.0.24-1.el7.i686
mysql-community-libs-compat-0:8.0.27-1.el7.i686
mysql-community-libs-0:8.0.13-1.el7.x86_64
mariadb-libs-1:5.5.56-2.amzn2.0.2.x86_64
mysql-workbench-community-0:8.0.17-1.el7.x86_64
mysql-community-devel-0:8.0.20-1.el7.x86_64
mysql-community-devel-0:8.0.21-1.el7.x86_64
mysql-community-libs-0:8.0.16-1.el7.x86_64

答案1

更新并修复

经过几个小时的尝试找出这个特定问题后,我最终决定尝试删除 postfix 并重新安装它。好消息是它有效并帮助找到了丢失的包裹。

这是我运行的命令:

#yum remove postifix
#yum clean all
#yum install postfix

现在这是安装输出:

# yum install postfix
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core                                                                                                                                                                     | 3.7 kB  00:00:00     
amzn2extra-docker                                                                                                                                                              | 3.0 kB  00:00:00     
amzn2extra-epel                                                                                                                                                                | 3.0 kB  00:00:00     
amzn2extra-kernel-5.10                                                                                                                                                         | 3.0 kB  00:00:00     
amzn2extra-nginx1                                                                                                                                                              | 3.0 kB  00:00:00     
amzn2extra-php8.0                                                                                                                                                              | 3.0 kB  00:00:00     
epel/x86_64/metalink                                                                                                                                                           |  22 kB  00:00:00     
epel                                                                                                                                                                           | 4.7 kB  00:00:00     
mysql-connectors-community                                                                                                                                                     | 2.6 kB  00:00:00     
mysql-tools-community                                                                                                                                                          | 2.6 kB  00:00:00     
mysql80-community                                                                                                                                                              | 2.6 kB  00:00:00     
(1/19): amzn2-core/2/x86_64/group_gz                                                                                                                                           | 2.5 kB  00:00:00     
(2/19): amzn2-core/2/x86_64/updateinfo                                                                                                                                         | 498 kB  00:00:00     
(3/19): amzn2extra-epel/2/x86_64/primary_db                                                                                                                                    | 1.8 kB  00:00:00     
(4/19): amzn2extra-kernel-5.10/2/x86_64/updateinfo                                                                                                                             |  18 kB  00:00:00     
(5/19): amzn2extra-docker/2/x86_64/updateinfo                                                                                                                                  | 6.4 kB  00:00:00     
(6/19): amzn2extra-epel/2/x86_64/updateinfo                                                                                                                                    |   76 B  00:00:00     
(7/19): amzn2extra-nginx1/2/x86_64/updateinfo                                                                                                                                  |   76 B  00:00:00     
(8/19): amzn2extra-docker/2/x86_64/primary_db                                                                                                                                  |  93 kB  00:00:00     
(9/19): amzn2extra-nginx1/2/x86_64/primary_db                                                                                                                                  |  48 kB  00:00:00     
(10/19): amzn2extra-php8.0/2/x86_64/updateinfo                                                                                                                                 |   76 B  00:00:00     
(11/19): amzn2extra-php8.0/2/x86_64/primary_db                                                                                                                                 | 181 kB  00:00:00     
(12/19): epel/x86_64/group_gz                                                                                                                                                  |  97 kB  00:00:00     
(13/19): epel/x86_64/updateinfo                                                                                                                                                | 1.1 MB  00:00:00     
(14/19): amzn2extra-kernel-5.10/2/x86_64/primary_db                                                                                                                            |  11 MB  00:00:00     
(15/19): epel/x86_64/primary_db                                                                                                                                                | 7.0 MB  00:00:00     
(16/19): mysql-connectors-community/x86_64/primary_db                                                                                                                          |  90 kB  00:00:00     
(17/19): mysql-tools-community/x86_64/primary_db                                                                                                                               |  87 kB  00:00:00     
(18/19): mysql80-community/x86_64/primary_db                                                                                                                                   | 211 kB  00:00:00     
(19/19): amzn2-core/2/x86_64/primary_db                                                                                                                                        |  65 MB  00:00:01     
293 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package postfix.x86_64 2:2.10.1-6.amzn2.0.3 will be installed
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 2:postfix-2.10.1-6.amzn2.0.3.x86_64
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 2:postfix-2.10.1-6.amzn2.0.3.x86_64
--> Running transaction check
---> Package mysql-community-libs-compat.x86_64 0:8.0.30-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================================================================
 Package                                                  Arch                                Version                                            Repository                                      Size
======================================================================================================================================================================================================
Installing:
 postfix                                                  x86_64                              2:2.10.1-6.amzn2.0.3                               amzn2-core                                     2.4 M
Installing for dependencies:
 mysql-community-libs-compat                              x86_64                              8.0.30-1.el7                                       mysql80-community                              670 k

Transaction Summary
======================================================================================================================================================================================================
Install  1 Package (+1 Dependent package)

正如您在这里所看到的,我的案例中丢失的包裹是mysql-community-libs-compat-8.0.30-1.el7.x86_64.

现在我得到以下信息:

# ls -al /usr/lib64/mysql
total 10984
drwxr-xr-x.  5 root root     233 Oct  4 12:41 .
dr-xr-xr-x. 49 root root   28672 Sep 29 13:49 ..
lrwxrwxrwx.  1 root root      20 Oct  4 12:41 libmysqlclient_r.so.18 -> libmysqlclient.so.18
lrwxrwxrwx.  1 root root      24 Oct  4 12:41 libmysqlclient_r.so.18.1.0 -> libmysqlclient.so.18.1.0
lrwxrwxrwx.  1 root root      24 Oct  4 12:41 libmysqlclient.so.18 -> libmysqlclient.so.18.1.0
-rwxr-xr-x.  1 root root 3546456 Jul  6 17:53 libmysqlclient.so.18.1.0
lrwxrwxrwx.  1 root root      25 Sep 28 21:53 libmysqlclient.so.21 -> libmysqlclient.so.21.2.30
-rwxr-xr-x.  1 root root 7651120 Jul  6 17:53 libmysqlclient.so.21.2.30
drwxr-xr-x.  4 root root      28 Sep 28 21:53 mecab
drwxr-xr-x.  2 root root    4096 Sep 28 21:53 plugin
drwxr-xr-x.  3 root root     131 Sep 28 21:53 private

最后,我运行了以下命令:

//Start Postfix
#systemctl start postfix

//Enable the service so it will start on its own after reboot
#systemctl enable postfix

//Check to ensure it is running with no errors
#systemctl status postfix

//The key portion of the output that I was looking for
Active: active (running)

最后,对其进行测试以确保其正常工作。这当然是在根据我的需要配置 Postfix 之后!

echo "Subject: My Test Email #1" | /usr/sbin/sendmail [email protected]

电子邮件已收到! :)

希望这能帮助其他有类似情况的人!

相关内容