If you tried all the howtos and it is still not fixed please do the following ,
This may be due to 64 32 bit incompatibility .
- Install mysql-devel packages from yum , if you are using default mysql otherwise get the correct version of mysql-devel and mysql-server 64 bit version , then here is the trick
remove /usr/lib/mysql
make the link " ln -s /usr/lib64/mysql /usr/lib/mysql
now " ldconfig "
Then add the following flag in custom build conf --with-mysql=/usr
Build it