3

When I try to start postfix I get these errors:

/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

Postfix use to work fine until I installed mysql. I'm not sure why mysql is even related to the Postfix errors.

When I run the find . -name 'libmysqlclient*' command I get this:

./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

There is no 18 version installed and I'm confused as to why it is looking for 18 instead of 21.

Further info which my be helpful:

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

Can anyone help me with this? I checked other posts on here which are similar to my issue, however, I wasn't able to find a solution that was close enough to my situation that I could try.

Finally, I also ran this command which outputs a ton of info which is why I saved this for the end of this post:

# 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
4
  • It seems Postfix is compiled against an older MySQL release. Is Postfix up to date on your system?
    – Kusalananda
    Commented Oct 4, 2022 at 6:47
  • @Kusalananda Thanks for responding. That is quite possible b/c I had issues getting MySQL to work at first so I uninstalled and reinstalled it. I also ran yum update postfix and it said everything was already up to date. Any way I can re-compile Postfix to grab the right one? Commented Oct 4, 2022 at 6:59
  • Recompile Postfix? No, that should not be necessary. You sohuld be using the Postfix that yum gives you. Do you have a system where some components are compiled locally, and others are installed via a package manager?
    – Kusalananda
    Commented Oct 4, 2022 at 7:07
  • No. Sorry, I wasn't sure what you meant by compiled against an older MySQL version, so I thought there may have been a compiling command that I was unaware of. This is a new AWS Linux 2 server and everything is up to date according to yum update. I only have the 1 version of Postfix installed. Am I better off uninstalling Postfix and reinstalling it? Would that work? Commented Oct 4, 2022 at 7:12

1 Answer 1

0

Update With Fix:

I finally decided to try and remove postfix and reinstall it after many hours of trying to figure out this particular issue. The good news is that it worked and helped with finding the missing package.

Here are the commands I ran:

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

And now here was the install output:

# 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)

As you can see here, the missing package in my case was mysql-community-libs-compat-8.0.30-1.el7.x86_64.

And now I get the following:

# 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

Finally, I ran the following:

//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)

Finally, test it to ensure it is working. This is of course after configuring Postfix to my needs!

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

Email received! :)

Hopefully, this will help others with a similar situation!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .