Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

Thanks.

share|improve this question

migrated from stackoverflow.com Sep 3 '09 at 22:37

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

4 Answers 4

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.
http://dev.mysql.com/doc/refman/5.0/en/configure-options.html

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
        linux-vdso.so.1 =>  (0x00007fffce7fe000)
        libc.so.6 => /lib64/libc.so.6 (0x000000391f000000)
        /lib64/ld-linux-x86-64.so.2 (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
        linux-gate.so.1 =>  (0x00139000)
        librt.so.1 => /lib/librt.so.1 (0x00ba2000)
        libdl.so.2 => /lib/libdl.so.2 (0x00ae3000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00b12000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x00bad000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x00be1000)
        libm.so.6 => /lib/libm.so.6 (0x00ae9000)
        libc.so.6 => /lib/libc.so.6 (0x0099d000)
        /lib/ld-linux.so.2 (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

 
discard

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.