3

postfix: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory

[root@localhost ~]# mysql -uroot -p*** -e "select version();"
Warning: Using a password on the command line interface can be insecure.
+-----------+
| version() |
+-----------+
| 5.6.29    |
+-----------+

[root@localhost ~]# cat /etc/redhat-release 
CentOS release 6.7 (Final)

[root@localhost ~]# rpm -qa postfix
postfix-2.6.6-6.el6_7.1.x86_64

After installed Zabbix 2.4.7 I cannot received email from zabbix, and I checked /var/log/maillog found lot error like this:

Apr 30 00:53:44 localhost postfix/master[1283]: warning: process /usr/libexec/postfix/pickup pid 55061 exit status 127
Apr 30 00:53:44 localhost postfix/master[1283]: warning: /usr/libexec/postfix/pickup: bad command startup -- throttling
Apr 30 00:54:44 localhost postfix/master[1283]: warning: process /usr/libexec/postfix/pickup pid 55069 exit status 127
Apr 30 00:54:44 localhost postfix/master[1283]: warning: /usr/libexec/postfix/pickup: bad command startup -- throttling
Apr 30 00:55:44 localhost postfix/master[1283]: warning: process /usr/libexec/postfix/pickup pid 55158 exit status 127
Apr 30 00:55:44 localhost postfix/master[1283]: warning: /usr/libexec/postfix/pickup: bad command startup -- throttling
Apr 29 17:30:26 localhost postfix/postfix-script[55619]: fatal: cannot execute /usr/sbin/postconf!
Apr 29 17:41:40 localhost postfix/postfix-script[55662]: fatal: cannot execute /usr/sbin/postconf!
Apr 29 17:41:49 localhost postfix/postfix-script[55666]: fatal: cannot execute /usr/sbin/postconf!
Apr 29 18:17:01 localhost postfix[55724]: fatal: usage: postfix [-c config_dir] [-Dv] command
Apr 29 18:17:08 localhost postfix/postfix-script[55727]: fatal: cannot execute /usr/sbin/postconf!
Apr 29 18:17:20 localhost postfix/postfix-script[55730]: fatal: cannot execute /usr/sbin/postconf!
Apr 29 18:34:54 localhost postfix/postfix-script[55751]: fatal: cannot execute /usr/sbin/postconf!

Then I checked postfix status, postfix can't start.

[root@localhost ~]# postfix status
postfix: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory
[root@localhost ~]# postfix start
postfix: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory

MySQL lib directory lists

[root@localhost ~]# ls -la /usr/local/mysql/lib/
total 216100
drwxr-xr-x.  3 mysql mysql      4096 Apr 29 18:16 .
drwxr-xr-x. 13 mysql mysql      4096 Mar 29 18:09 ..
-rw-r--r--.  1 mysql mysql  11524834 Mar 29 01:35 libmysqlclient.a
lrwxrwxrwx.  1 mysql mysql        16 Mar 29 01:39 libmysqlclient_r.a -> libmysqlclient.a
lrwxrwxrwx.  1 mysql mysql        17 Mar 29 01:39 libmysqlclient_r.so -> libmysqlclient.so
lrwxrwxrwx.  1 mysql mysql        20 Mar 29 01:39 libmysqlclient_r.so.18 -> libmysqlclient.so.18
lrwxrwxrwx.  1 mysql mysql        24 Mar 29 01:39 libmysqlclient_r.so.18.1.0 -> libmysqlclient.so.18.1.0
lrwxrwxrwx.  1 mysql mysql        20 Mar 29 01:39 libmysqlclient.so -> libmysqlclient.so.18
lrwxrwxrwx.  1 mysql mysql        24 Mar 29 01:39 libmysqlclient.so.18 -> libmysqlclient.so.18.1.0
-rwxr-xr-x.  1 mysql mysql   5865820 Mar 29 01:35 libmysqlclient.so.18.1.0
-rw-r--r--.  1 mysql mysql 203859198 Mar 29 01:38 libmysqld.a
-rw-r--r--.  1 mysql mysql     14270 Mar 29 01:35 libmysqlservices.a
drwxr-xr-x.  3 mysql mysql      4096 Mar 29 01:39 plugin

I also tried to link libmysqlclient.so.18 to libmysqlclient.so.16, problem did't solved.

[root@localhost ~]# ln -s  /usr/local/mysql/lib/libmysqlclient.so /usr/lib64/libmysqlclient.so.16
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# postfix start
/usr/sbin/postconf: /usr/lib64/libmysqlclient.so.16: version `libmysqlclient_16' not found (required by /usr/sbin/postconf)
postfix/postfix-script: fatal: cannot execute /usr/sbin/postconf!
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# less /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/lib/
/usr/local/mysql/lib
jasonwryan
  • 73,126
Gavin
  • 33
  • This kind of issue is generally what happens when you ignore your distribution's package management system and manually install binary packages without checking dependencies. Was there a reason you did that? – Shadur-don't-feed-the-AI May 03 '16 at 07:59

1 Answers1

0

The package containing older mysql-libs is available on the remi repository.

You start by installing the repository:

wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6.rpm

Then you can install the package:

yum install compat-mysql51.x86_64
  • tks. I download the compat from http://downloads.mysql.com/archives/get/file/MySQL-shared-compat-5.5.48-1.el6.x86_64.rpm – Gavin May 03 '16 at 05:34