I'm trying to run a compiled 32-bit binary on a 64-bit CentOS 5.3 (based on RedHat 4.1.2) host. The binary complains about inability to find libmysqlclient.so.15. Such a file exists on the server, but it's 64-bit and therefore not good.
Can I install the 32-bit MySQL client libraries on the host? Preferably in the official way (i. e. via a repository). If not, what about a hackish way?
Also, is this a proper venue for such a question?
EDIT: here's an article that confirms that you cannot mix and match bitness within one process. But its recipe is not applicable to CentOS.
Wikipedia states that RHEL, which CentOS derives from, is capable of having a full 32-bit userland running along 64-bit… There are already some 32-bit libraries on the system – libc
and such. Just not MySQL.
I can run other 32-bit binaries that don't link to libmysqlclient.
EDIT: yum search mysql
says the following:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.symnds.com
* extras: mirror.symnds.com
* updates: mirror.wiredtree.com
addons | 1.9 kB 00:00
base | 1.1 kB 00:00
extras | 1.9 kB 00:00
updates | 1.9 kB 00:00
Excluding Packages in global exclude list
Finished
================================ Matched: mysql ================================
mod_auth_mysql.x86_64 : Basic authentication for the Apache web server using a
: MySQL database.
qt-MySQL.x86_64 : MySQL drivers for Qt's SQL classes.
MySQL-bench.x86_64 : MySQL - Benchmarks and test system
MySQL-client.x86_64 : MySQL - Client
MySQL-devel.x86_64 : MySQL - Development header files and libraries
MySQL-python.x86_64 : An interface to MySQL
MySQL-server.x86_64 : MySQL: a very fast and reliable SQL database server
MySQL-shared.x86_64 : MySQL - Shared libraries
apr-util-mysql.x86_64 : APR utility library MySQL DBD driver
bytefx-data-mysql.x86_64 : MySQL database connectivity for Mono
freeradius-mysql.x86_64 : MySQL bindings for freeradius
freeradius2-mysql.x86_64 : MySQL support for freeradius
libdbi-dbd-mysql.x86_64 : MySQL plugin for libdbi
pdns-backend-mysql.x86_64 : MySQL backend for pdns
pure-ftpd.x86_64 : Lightweight, fast and secure FTP server
qt4-mysql.x86_64 : MySQL drivers for Qt's SQL classes
rsyslog.x86_64 : Enhanced system logging and kernel message trapping daemon
rsyslog-mysql.x86_64 : MySQL support for rsyslog
unixODBC.i386 : A complete ODBC driver manager for Linux
unixODBC.x86_64 : A complete ODBC driver manager for Linux
unixODBC64.x86_64 : A complete ODBC driver manager for Linux
Best Answer
1. Installation
Your MySQL installation could have come from different sources. It could be an rpm that came with the distribution or a Sun/Oracle rpm or it could have been built from sources.
should tell you the name of the package like
MySQL-client-...
mysql-5.0...
mysql-community-server-client
mysql-5.1...
no package provides /usr/bin/mysql
.On CentOS the first two options are most likely.
MySQL-client-5.0
is a Sun/Oracle RPM andmysql-5.0
could have come from the distribution. Userpm -q --info <package_name>
to get extended information and verify that theVendor:
line confirms the hypothesis.Here is a typical Vendor line:
1.1 MySQL from Sun/Oracle RPMs
If your mysql installation comes from Sun/Oracle, go to MySQL Community server download page, select among Generally Available (GA) releases the one that has mysql 5.0 version and 32-bit architecture, choose MySQL-shared-community package, download and install it with
rpm -i
. This package provides exactly the/usr/lib/libmysqlclient.so.15
library.1.2 mysql from CentOS
In CentOS5 libmysqlclient belongs to the mysql package.
should do the trick.
In CentOS6 it was moved to a separate mysql-libs package.
2. Testing
After installing the library, check if dynamic library dependencies are resolved correctly:
should return something like
If you want to know what provides a 32-bit version of a specific 64-bit library, you could use
rpm -q --whatprovides /path/to/your/lib64/library
to determine the name of the package. Then replace x86_64 with i686 in the name to get the name of the 32-bit counterpart. Useyum search
to verify if the package is provided by the repositories you have subscribed to.