1

So I am trying to compile Bind with DLZ ( mysql ) support on CentOS 7

After doing

 ./configure --prefix=/usr --sysconfdir=/etc/bind --localstatedir=/var --mandir=/usr/share/man --infodir=/usr/share/info --enable-threads --enable-largefile --with-libtool --enable-shared --enable-static --with-openssl=/usr --with-gssapi=/usr --with-gnu-ld --with-dlz-postgres=no --with-dlz-mysql=yes --with-dlz-bdb=no --with-dlz-filesystem=yes  --with-dlz-stub=yes --enable-ipv6

and

make

I get the error:

 /opt/bind/bind-9.11.0-P3/lib/isc/.libs/libisc.so ../../lib/isc/.libs/libisc.so -lcrypto -L/usr/lib/mysql -lmysqlclient -lcrypt -lm -ldl -lz -lpthread
 /usr/bin/ld: cannot find -lmysqlclient
 collect2: error: ld returned 1 exit status
 make[2]: *** [named] Error 1
 make[2]: Leaving directory `/opt/bind/bind-9.11.0-P3/bin/named'
 make[1]: *** [subdirs] Error 1
 make[1]: Leaving directory `/opt/bind/bind-9.11.0-P3/bin'
 make: *** [subdirs] Error 1

I have gotten it to work on one CentOS 7 box, however I installed all sorts of whacky stuff while trying to get it to work. I don't actually know why it compiles on that machine, and I would like to be able to replicate the process. So I created a fresh install of CentOS 7 and try and find out how to compile Bind with DLZ support. Bind 9.11.0-P3.

I have mariadb-libs installed and the /usr/lib64/mysql directory looks like this.

ll /usr/lib64/mysql/ total 16884 -rw-r--r--. 1 root root 2687 Nov 14 15:15 INFO_BIN -rw-r--r--. 1 root root 170 Sep 12 2016 INFO_SRC lrwxrwxrwx. 1 root root 17 Mar 29 16:40 libmysqlclient_r.so -> libmysqlclient.so lrwxrwxrwx. 1 root root 20 Mar 29 16:40 libmysqlclient.so -> libmysqlclient.so.18 lrwxrwxrwx. 1 root root 24 Mar 29 16:40 libmysqlclient.so.18 -> libmysqlclient.so.18.0.0 -rwxr-xr-x. 1 root root 3135736 Nov 14 15:17 libmysqlclient.so.18.0.0 lrwxrwxrwx. 1 root root 15 Mar 29 16:40 libmysqld.so -> libmysqld.so.18 -rwxr-xr-x. 1 root root 14116296 Nov 14 15:17 libmysqld.so.18 -rwxr-xr-x. 1 root root 10474 Nov 14 15:14 mysqlbug -rwxr-xr-x. 1 root root 6758 Nov 14 15:15 mysql_config drwxr-xr-x. 2 root root 4096 Mar 29 16:40 plugin

The /usr/lib/mysql directory looks like this.

ll /usr/lib/mysql/ total 0 drwxr-xr-x. 2 root root 6 Mar 29 21:36 plugin

On the machine that Bind Compiles on the /usr/lib/mysql folder looks different, and when I do yum whatprovides on the other machine I get this result:

yum whatprovides /usr/lib/mysql/libmysqlclient.so.18.0.0 Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: centos.mirror.ca.planethoster.net * extras: centos.mirror.ca.planethoster.net * updates: mirror.it.ubc.ca * webtatic: us-east.repo.webtatic.com 1:mariadb-libs-5.5.52-1.el7.i686 : The shared libraries required for MariaDB/MySQL clients Repo : base Matched from: Filename : /usr/lib/mysql/libmysqlclient.so.18.0.0 1:mariadb-libs-5.5.52-1.el7.x86_64 : The shared libraries required for MariaDB/MySQL clients Repo : @base Matched from: Filename : /usr/lib/mysql/libmysqlclient.so.18.0.0

On the fresh install I have installed these mariadb packages.

yum list mariadb*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.its.sfu.ca
 * extras: centos.bhs.mirrors.ovh.net
 * updates: mirror.its.sfu.ca
Installed Packages
mariadb.x86_64                               1:5.5.52-1.el7                @base
mariadb-bench.x86_64                         1:5.5.52-1.el7                @base
mariadb-devel.x86_64                         1:5.5.52-1.el7                @base
mariadb-embedded.x86_64                      1:5.5.52-1.el7                @base
mariadb-embedded-devel.x86_64                1:5.5.52-1.el7                @base
mariadb-libs.x86_64                          1:5.5.52-1.el7                @base
mariadb-server.x86_64                        1:5.5.52-1.el7                @base
mariadb-test.x86_64                          1:5.5.52-1.el7                @base
Available Packages

Please help me figure out how to install Bind with DLZ support on CentOS 7!

Rahim Khoja
  • 695
  • 13
  • 26
  • I copied the /usr/lib64/mysql to /usr/lib/mysql and it worked right away. strangely when I manually add the directory to the configure file it ignores it. – Rahim Khoja Apr 01 '17 at 01:49

1 Answers1

2

Add 'LDFLAGS="-I/usr/include/mysql -L/usr/lib64/mysql"' on to the ./configure command

like so

./configure --prefix=/usr --sysconfdir=/etc/bind --localstatedir=/var --mandir=/usr/share/man --infodir=/usr/share/info --enable-threads --enable-largefile --with-libtool --enable-shared --enable-static --with-openssl=/usr --with-gssapi=/usr --with-gnu-ld --with-dlz-postgres=no --with-dlz-mysql=yes --with-dlz-bdb=no --with-dlz-filesystem=yes --with-dlz-stub=yes --enable-ipv6 LDFLAGS="-I/usr/include/mysql -L/usr/lib64/mysql"

Rahim Khoja
  • 695
  • 13
  • 26