mysql: error while loading shared libraries: libmysqlclient.so.16

mysql卸载后重装报错:

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


1. checking for libmysqlclient installed.

[root@node01 mysqli]# ldconfig -v | grep mysql
/usr/lib64/mysql:
libmysqlclient_r.so.16 -> libmysqlclient_r.so.16.0.0
libmysqlclient.so.16 -> libmysqlclient.so.16.0.0
[root@node01 mysqli]#
[root@node01 mysqli]# locate libmysqlclient.so
/usr/lib64/mysql/libmysqlclient.so
/usr/lib64/mysql/libmysqlclient.so.16
/usr/lib64/mysql/libmysqlclient.so.16.0.0
[root@node01 mysqli]#

if output empty then simply run these commands on rpm\yum based linux:

yum install mysql-devel mysql-libs

2. re-compile php-mysql module with path to lib64 folder.

./configure �Cwith-php-config=/usr/local/php/bin/php-config �Cwith-mysql=/usr/bin/ �Cwith-libdir=lib64

3. alternative solution is:

[root@node01 mysql]# ln -s /usr/lib64/mysql/libmysqlclient.so /usr/lib/mysql/libmysqlclient.so

This entry was posted in CentOS, Fedora, Linux, MySQL, OS, RedHat by stealth. Bookmark the permalink.


转载自:http://ntcn.net/blog/?p=6575

你可能感兴趣的:(mysql,error,loading,shared)