configure: error: Cannot find libmysqlclient under /usr

Recently I was configuring PHP with Mysql manually and it was really annoying to see the “Cannot find libmysqlclient under /usr” error message. The configure line I used to install PHP was

./configure --with-mysql  --with-libdir=/usr/lib

and the error that I received was

checking for MySQL UNIX socket location... /var/lib/mysql/mysql.sock
configure: error: Cannot find libmysqlclient under /usr.
Note that the MySQL client library is not bundled anymore!

The error occurred because libmysqlclient wasn’t present in the /usr/lib directory. On further investigation, I noticed the libmysqlclient is installed in the /usr/lib64 directory because the server is a 64bit machine.

So the fix for the “mysql: Cannot find libmysqlclient under /usr” error message is to provide lib64 directory path in the configure line.

The configure line should read as follows:

./configure --with-mysql --with-libdir=lib64

That’s it.

This entry was posted on Monday, September 3rd, 2012 and is filed under Linux Administration. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Comments are closed.