Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to build an ape server on Centos 5.6 but getting the following message:

/usr/bin/ld: cannot find -lmysqlclient_r collect2: ld returned 1 exit status make: * [modules] Error 1

How can I get it working? I've found in /usr/lib64/mysql and /usr/lib/mysql/ are these the files it needs? If so, how can i get ld to see them?

share|improve this question

To make this work, you must edit the Makefile in the modules directory. On line 7 change

    MYSQL_FLAGS = -L./deps/mysac/ -I./deps/mysac/ -lmysac -lmysqlclient_r


    MYSQL_FLAGS = -L./deps/mysac/ -L/usr/lib64/mysql -I./deps/mysac/ -lmysac -lmysqlclient_r
share|improve this answer

You probably need to install the -devel RPM for MySQL.

To see whether that's available, try:

yum provides '*/'

If for some reason it's not been seen, you can try:

LD_LIBRARY_PATH=/usr/lib64/mysql make
share|improve this answer
I already have it installed under mysql-devel! – Paul Jun 9 '11 at 22:12
try the command above to see if it helps. – Philip Reynolds Jun 9 '11 at 22:14
no, still the same response – Paul Jun 10 '11 at 7:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.