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 have MySQL server 5.0.67 running on a Linux machine.
How can I know what configure options were used to compile it??

I'm interested in the option --with-mysqld-ldflags in order to know whether mysql was linked statically or dynamically.

share|improve this question

migrated from Sep 3 '09 at 22:37

This question came from our site for professional and enthusiast programmers.

up vote 4 down vote accepted

You can see the configure options using the mysqlbug command-line utility.

In your shell type mysqlbug and you'll see a template e-mail for bug submission.
At the bottom end of that e-mail you can see the configure line with all the options your copy of MySQL was compiled with.

The --with-mysqld-ldflags is omitted by default and it means the server will be compiled dynamically.

share|improve this answer

It won't get you exactly what you asked for, but you can check if a binary is statically linked or not (and if it is dynamically linked, what libraries it is linked against) with ldd.

When the binary is dynamically linked, the output looks similar to this:

$ ldd test-dyn =>  (0x00007fffce7fe000) => /lib64/ (0x000000391f000000)
        /lib64/ (0x000000391ec00000)

... and on a statically linked binary, like this:

$ ldd test-stat
        not a dynamic executable
share|improve this answer

Which version of Linux? The details will be in the source package.

For Debian/Ubuntu based you can get the source package with apt-get source packagename. Then look at the debian/rules script that runs the build.

share|improve this answer

When I run ldd I get this:

root@hostname3 [~]# ldd /usr/sbin/mysqld =>  (0x00139000) => /lib/ (0x00ba2000) => /lib/ (0x00ae3000) => /lib/ (0x00b12000) => /lib/ (0x00bad000) => /lib/ (0x00be1000) => /lib/ (0x00ae9000) => /lib/ (0x0099d000)
        /lib/ (0x0097f000)

Does it mean mysqld is statically linked??

share|improve this answer
Nope, this means it's dynamically linked against the libraries listed there. – andri Apr 5 '09 at 1:18
Oh, great. That's what I need because I have to add some UDFs to the server. In the case a server is statically linked, how would the output of ldd look like?? (I need to check this on other machines too) – GetFree Apr 5 '09 at 1:24
I've edited my original post with details about that. – andri Apr 5 '09 at 1:28

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.